using reverse! when possible.

db4
John Benediktsson 2012-04-25 20:09:36 -07:00
parent 664908c78f
commit 5e16810075
4 changed files with 4 additions and 4 deletions

View File

@ -128,7 +128,7 @@ PRIVATE>
[ first-grapheme ] >pieces ;
: string-reverse ( str -- rts )
>graphemes reverse concat ;
>graphemes reverse! concat ;
<PRIVATE

View File

@ -102,7 +102,7 @@ M: predicate reset-word
dup class? [ "superclass" word-prop ] [ drop f ] if ;
: superclasses ( class -- supers )
[ superclass ] follow reverse ;
[ superclass ] follow reverse! ;
: superclass-of? ( class superclass -- ? )
superclasses member-eq? ;

View File

@ -87,7 +87,7 @@ ERROR: no-cond ;
: cond>quot ( assoc -- quot )
[ dup pair? [ [ t ] swap 2array ] unless ] map
reverse [ no-cond ] swap alist>quot ;
reverse! [ no-cond ] swap alist>quot ;
! case
ERROR: no-case object ;

View File

@ -48,7 +48,7 @@ PRIVATE>
dupd find drop [ swap [ dup 1 + ] dip snip ] [ f ] if* ; inline
: split1-last ( seq subseq -- before after )
[ <reversed> ] bi@ split1 [ reverse ] bi@
[ <reversed> ] bi@ split1 [ reverse! ] bi@
dup [ swap ] when ;
: split1-last-slice ( seq subseq -- before-slice after-slice )