@@ -275,10 +275,10 @@ function(filename)
275
275
fi ;
276
276
277
277
splitname := SplitString(filename, " ." );
278
- extension := splitname [ Length (splitname)] ;
278
+ extension := Remove (splitname);
279
279
280
280
if extension in [ " gz" , " bz2" , " xz" ] then
281
- extension := splitname [ Length (splitname) - 1 ] ;
281
+ extension := Remove (splitname);
282
282
fi ;
283
283
284
284
if extension = " txt" then
@@ -313,10 +313,10 @@ function(filename)
313
313
fi ;
314
314
315
315
splitname := SplitString(filename, " ." );
316
- extension := splitname [ Length (splitname)] ;
316
+ extension := Remove (splitname);
317
317
318
318
if extension in [ " gz" , " bz2" , " xz" ] then
319
- extension := splitname [ Length (splitname) - 1 ] ;
319
+ extension := Remove (splitname);
320
320
fi ;
321
321
322
322
if extension = " txt" then
@@ -549,9 +549,8 @@ function(arg...)
549
549
# the file encoder was not specified and cannot be deduced from the
550
550
# filename, so we try to make a guess based on the digraphs themselves
551
551
splitname := SplitString(name, " ." );
552
- if splitname[ Length(splitname)] in [ " xz" , " gz" , " bz2" ] then
553
- compext := splitname[ Length(splitname)] ;
554
- splitname := splitname{[ 1 .. Length(splitname) - 1 ]} ;
552
+ if Last(splitname) in [ " xz" , " gz" , " bz2" ] then
553
+ compext := Remove(splitname);
555
554
fi ;
556
555
557
556
# Do we know all the graphs to be symmetric?
@@ -647,7 +646,7 @@ function(arg...)
647
646
" is a whole file encoder, and so only one digraph should be " ,
648
647
" specified. Only the last digraph will be encoded." );
649
648
fi ;
650
- IO_Write(file, encoder(digraphs [ Length (digraphs)] ));
649
+ IO_Write(file, encoder(Last (digraphs)));
651
650
else
652
651
for i in [ 1 .. Length(digraphs)] do
653
652
encoder(file, digraphs[ i] );
@@ -715,7 +714,7 @@ function(filt, s)
715
714
maxedges := n * (n - 1 ) / 2 ;
716
715
if list <> [ 0 ] and list <> [ 1 ] and
717
716
not (Int((maxedges - 1 ) / 6 ) + start = Length(list) and
718
- list [ Length (list)] mod 2 ^ ((0 - maxedges) mod 6 ) = 0 ) then
717
+ Last (list) mod 2 ^ ((0 - maxedges) mod 6 ) = 0 ) then
719
718
ErrorNoReturn(" the 2nd argument <s> is not a valid graph6 string," );
720
719
fi ;
721
720
@@ -732,8 +731,8 @@ function(filt, s)
732
731
i := i / 2 ;
733
732
else
734
733
edge := FindCoord(pos + 6 - bpos, 0 );
735
- out [ edge [ 1 ]][ Length (out[ edge[ 1 ]] ) + 1 ] := edge[ 2 ] ;
736
- out [ edge [ 2 ]][ Length (out[ edge[ 2 ]] ) + 1 ] := edge[ 1 ] ;
734
+ Add (out[ edge[ 1 ]] , edge[ 2 ] ) ;
735
+ Add (out[ edge[ 2 ]] , edge[ 1 ] ) ;
737
736
nredges := nredges + 1 ;
738
737
i := (i - 1 ) / 2 ;
739
738
fi ;
@@ -2165,7 +2164,7 @@ function(args...)
2165
2164
positions := PositionsProperty(partition, x -> x = i);
2166
2165
joinedPositions := JoinStringsWithSeparator(positions, " " );
2167
2166
partitionString := Concatenation(partitionString, joinedPositions);
2168
- if i <> dflabels [ Length (dflabels)] then
2167
+ if i <> Last (dflabels) then
2169
2168
partitionString := Concatenation(partitionString, " | " );
2170
2169
fi ;
2171
2170
od ;
0 commit comments