using reverse! when possible.
parent
664908c78f
commit
5e16810075
|
@ -128,7 +128,7 @@ PRIVATE>
|
||||||
[ first-grapheme ] >pieces ;
|
[ first-grapheme ] >pieces ;
|
||||||
|
|
||||||
: string-reverse ( str -- rts )
|
: string-reverse ( str -- rts )
|
||||||
>graphemes reverse concat ;
|
>graphemes reverse! concat ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ M: predicate reset-word
|
||||||
dup class? [ "superclass" word-prop ] [ drop f ] if ;
|
dup class? [ "superclass" word-prop ] [ drop f ] if ;
|
||||||
|
|
||||||
: superclasses ( class -- supers )
|
: superclasses ( class -- supers )
|
||||||
[ superclass ] follow reverse ;
|
[ superclass ] follow reverse! ;
|
||||||
|
|
||||||
: superclass-of? ( class superclass -- ? )
|
: superclass-of? ( class superclass -- ? )
|
||||||
superclasses member-eq? ;
|
superclasses member-eq? ;
|
||||||
|
|
|
@ -87,7 +87,7 @@ ERROR: no-cond ;
|
||||||
|
|
||||||
: cond>quot ( assoc -- quot )
|
: cond>quot ( assoc -- quot )
|
||||||
[ dup pair? [ [ t ] swap 2array ] unless ] map
|
[ dup pair? [ [ t ] swap 2array ] unless ] map
|
||||||
reverse [ no-cond ] swap alist>quot ;
|
reverse! [ no-cond ] swap alist>quot ;
|
||||||
|
|
||||||
! case
|
! case
|
||||||
ERROR: no-case object ;
|
ERROR: no-case object ;
|
||||||
|
|
|
@ -48,7 +48,7 @@ PRIVATE>
|
||||||
dupd find drop [ swap [ dup 1 + ] dip snip ] [ f ] if* ; inline
|
dupd find drop [ swap [ dup 1 + ] dip snip ] [ f ] if* ; inline
|
||||||
|
|
||||||
: split1-last ( seq subseq -- before after )
|
: split1-last ( seq subseq -- before after )
|
||||||
[ <reversed> ] bi@ split1 [ reverse ] bi@
|
[ <reversed> ] bi@ split1 [ reverse! ] bi@
|
||||||
dup [ swap ] when ;
|
dup [ swap ] when ;
|
||||||
|
|
||||||
: split1-last-slice ( seq subseq -- before-slice after-slice )
|
: split1-last-slice ( seq subseq -- before-slice after-slice )
|
||||||
|
|
Loading…
Reference in New Issue