diff --git a/extra/locals/locals.factor b/extra/locals/locals.factor index eb10735c06..8c8fa96fa5 100755 --- a/extra/locals/locals.factor +++ b/extra/locals/locals.factor @@ -81,16 +81,24 @@ C: quote UNION: special local quote local-word local-reader local-writer ; : load-locals-quot ( args -- quot ) - dup [ local-reader? ] contains? [ - [ - local-reader? [ 1array >r ] [ >r ] ? - ] map concat + dup empty? [ + drop [ ] ] [ - length [ load-locals ] curry >quotation + dup [ local-reader? ] contains? [ + [ + local-reader? [ 1array >r ] [ >r ] ? + ] map concat + ] [ + length [ load-locals ] curry >quotation + ] if ] if ; : drop-locals-quot ( args -- quot ) - length [ drop-locals ] curry ; + dup empty? [ + drop [ ] + ] [ + length [ drop-locals ] curry + ] if ; : point-free-body ( quot args -- newquot ) >r 1 head-slice* r> [ localize ] curry map concat ;