Slightly shorter code generated by locals
parent
2149491044
commit
9453ce2f30
|
@ -81,16 +81,24 @@ C: <quote> quote
|
||||||
UNION: special local quote local-word local-reader local-writer ;
|
UNION: special local quote local-word local-reader local-writer ;
|
||||||
|
|
||||||
: load-locals-quot ( args -- quot )
|
: load-locals-quot ( args -- quot )
|
||||||
dup [ local-reader? ] contains? [
|
dup empty? [
|
||||||
<reversed> [
|
drop [ ]
|
||||||
local-reader? [ 1array >r ] [ >r ] ?
|
|
||||||
] map concat
|
|
||||||
] [
|
] [
|
||||||
length [ load-locals ] curry >quotation
|
dup [ local-reader? ] contains? [
|
||||||
|
<reversed> [
|
||||||
|
local-reader? [ 1array >r ] [ >r ] ?
|
||||||
|
] map concat
|
||||||
|
] [
|
||||||
|
length [ load-locals ] curry >quotation
|
||||||
|
] if
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
: drop-locals-quot ( args -- quot )
|
: drop-locals-quot ( args -- quot )
|
||||||
length [ drop-locals ] curry ;
|
dup empty? [
|
||||||
|
drop [ ]
|
||||||
|
] [
|
||||||
|
length [ drop-locals ] curry
|
||||||
|
] if ;
|
||||||
|
|
||||||
: point-free-body ( quot args -- newquot )
|
: point-free-body ( quot args -- newquot )
|
||||||
>r 1 head-slice* r> [ localize ] curry map concat ;
|
>r 1 head-slice* r> [ localize ] curry map concat ;
|
||||||
|
|
Loading…
Reference in New Issue