with-lambda-scope ( assoc reader-quot: ( -- quot ) -- quot ) (original) (raw)
with-lambda-scope ( assoc reader-quot: ( -- quot ) -- quot )
Inputs
assoc | local variables |
---|---|
reader-quot | a quotation |
Outputs
quot | a quotation |
---|
Word description
Runs the quotation in a lambda scope. That means that any local variables are available for lookup in the manifest, but are cleaned up after the quotation finishes.
Definition
USING: kernel namespaces parser vocabs.parser ;
: with-lambda-scope
( assoc reader-quot: ( -- quot ) -- quot )
H{ { quotation-parser lambda-parser } { in-lambda? t } }
-rot [ with-words ] 2curry with-variables ; inline