modern.compiler: fix map-literals

modern-harvey2
Doug Coleman 2017-09-03 12:30:53 -05:00
parent 26f74e9d83
commit 2e89f86d16
1 changed files with 5 additions and 6 deletions

View File

@ -102,19 +102,18 @@ VARIABLE-ARITY: \<FUNCTOR: 2
drop f
] if ;
DEFER: map-literals
: (map-literals) ( obj quot: ( obj -- obj' ) -- seq )
over matched-literal? [
over [ array? ] any? [
[ call drop ] [
'[
first3 [ [ _ (map-literals) ] map ] dip 3array
] call
map-literals
] 2bi
] [
call
over array? [ map-literals ] [ call ] if
] if ; inline recursive
: map-literals ( obj quot: ( obj -- obj' ) -- seq )
'[ _ (map-literals) ] map ; inline
'[ _ (map-literals) ] map ; inline recursive