modern: Fix arity for paths.
parent
b7c82eed0c
commit
0ad2c54f55
|
@ -259,4 +259,4 @@ IN: sequences.extras.tests
|
||||||
[ 3 { 1 1 2 1 1 1 } [ 2 = not ] head-nth-match ] unit-test
|
[ 3 { 1 1 2 1 1 1 } [ 2 = not ] head-nth-match ] unit-test
|
||||||
|
|
||||||
{ { 1 1 2 1 } { 1 1 } }
|
{ { 1 1 2 1 } { 1 1 } }
|
||||||
[ 3 { 1 1 2 1 1 1 } [ 2 = not ] cut-nth-match ] unit-test
|
[ 3 { 1 1 2 1 1 1 } [ 2 = not ] cut-nth-match ] unit-test
|
||||||
|
|
|
@ -233,10 +233,6 @@ M: compound-sequence-literal write-literal
|
||||||
call
|
call
|
||||||
] if ; inline recursive
|
] if ; inline recursive
|
||||||
|
|
||||||
: rewrite-path ( path quot -- )
|
|
||||||
! dup print
|
|
||||||
$[ [ path>literals [ _ map-literals ] map ] [ ] bi write-modern-path ]
|
|
||||||
[ drop . ] recover ; inline
|
|
||||||
|
|
||||||
GENERIC: split-arity ( obj -- seq ) ;
|
GENERIC: split-arity ( obj -- seq ) ;
|
||||||
|
|
||||||
|
@ -254,6 +250,17 @@ M: less-than-literal split-arity
|
||||||
|
|
||||||
M: object split-arity ;
|
M: object split-arity ;
|
||||||
|
|
||||||
|
|
||||||
|
: rewrite-path ( path quot -- )
|
||||||
|
! dup print
|
||||||
|
$[
|
||||||
|
[
|
||||||
|
path>literals
|
||||||
|
[ _ map-literals ] map
|
||||||
|
[ split-arity ] map
|
||||||
|
] [ ] bi write-modern-path ]
|
||||||
|
[ drop . ] recover ; inline
|
||||||
|
|
||||||
: rewrite-string ( string quot -- )
|
: rewrite-string ( string quot -- )
|
||||||
! dup print
|
! dup print
|
||||||
[ string>literals ] dip $[ _ map-literals ] map
|
[ string>literals ] dip $[ _ map-literals ] map
|
||||||
|
|
Loading…
Reference in New Issue