More efficient branch? word
parent
74197538f5
commit
9cc761d899
|
@ -5,10 +5,12 @@ IN: sequences.deep
|
||||||
|
|
||||||
! All traversal goes in postorder
|
! All traversal goes in postorder
|
||||||
|
|
||||||
: branch? ( object -- ? )
|
GENERIC: branch? ( object -- ? )
|
||||||
dup sequence? [
|
|
||||||
dup string? swap number? or not
|
M: sequence branch? drop t ;
|
||||||
] [ drop f ] if ;
|
M: integer branch? drop f ;
|
||||||
|
M: string branch? drop f ;
|
||||||
|
M: object branch? drop f ;
|
||||||
|
|
||||||
: deep-each ( obj quot: ( elt -- ) -- )
|
: deep-each ( obj quot: ( elt -- ) -- )
|
||||||
[ call ] 2keep over branch?
|
[ call ] 2keep over branch?
|
||||||
|
|
Loading…
Reference in New Issue