@@ -275,10 +275,10 @@ function(filename)
275275 fi ;
276276
277277 splitname := SplitString(filename, " ." );
278- extension := splitname [ Length (splitname)] ;
278+ extension := Remove (splitname);
279279
280280 if extension in [ " gz" , " bz2" , " xz" ] then
281- extension := splitname [ Length (splitname) - 1 ] ;
281+ extension := Remove (splitname);
282282 fi ;
283283
284284 if extension = " txt" then
@@ -313,10 +313,10 @@ function(filename)
313313 fi ;
314314
315315 splitname := SplitString(filename, " ." );
316- extension := splitname [ Length (splitname)] ;
316+ extension := Remove (splitname);
317317
318318 if extension in [ " gz" , " bz2" , " xz" ] then
319- extension := splitname [ Length (splitname) - 1 ] ;
319+ extension := Remove (splitname);
320320 fi ;
321321
322322 if extension = " txt" then
@@ -549,9 +549,8 @@ function(arg...)
549549 # the file encoder was not specified and cannot be deduced from the
550550 # filename, so we try to make a guess based on the digraphs themselves
551551 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);
555554 fi ;
556555
557556 # Do we know all the graphs to be symmetric?
@@ -647,7 +646,7 @@ function(arg...)
647646 " is a whole file encoder, and so only one digraph should be " ,
648647 " specified. Only the last digraph will be encoded." );
649648 fi ;
650- IO_Write(file, encoder(digraphs [ Length (digraphs)] ));
649+ IO_Write(file, encoder(Last (digraphs)));
651650 else
652651 for i in [ 1 .. Length(digraphs)] do
653652 encoder(file, digraphs[ i] );
@@ -715,7 +714,7 @@ function(filt, s)
715714 maxedges := n * (n - 1 ) / 2 ;
716715 if list <> [ 0 ] and list <> [ 1 ] and
717716 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
719718 ErrorNoReturn(" the 2nd argument <s> is not a valid graph6 string," );
720719 fi ;
721720
@@ -732,8 +731,8 @@ function(filt, s)
732731 i := i / 2 ;
733732 else
734733 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 ] ) ;
737736 nredges := nredges + 1 ;
738737 i := (i - 1 ) / 2 ;
739738 fi ;
@@ -2165,7 +2164,7 @@ function(args...)
21652164 positions := PositionsProperty(partition, x -> x = i);
21662165 joinedPositions := JoinStringsWithSeparator(positions, " " );
21672166 partitionString := Concatenation(partitionString, joinedPositions);
2168- if i <> dflabels [ Length (dflabels)] then
2167+ if i <> Last (dflabels) then
21692168 partitionString := Concatenation(partitionString, " | " );
21702169 fi ;
21712170 od ;
0 commit comments