Skip to content

correct way to provide initial slot value using a variable #312

Closed Answered by tarsius
mooseyboots asked this question in Q&A
Discussion options

You must be logged in to vote

if i don't quote the lambda, a closure object is returned, which i am unable to do much of anything with to obtain its value.

but then if i also want to set the slot to a different variable when defining an infix in a transient prefix, i can't quote the lambda, as nothing is evaluated in this context.

lambda expressions should virtually never be quoted. If you don't quote them, then it just works in both of these places.

Think of the closure object not as something scary, but as the evaluated lambda. If you quote a lambda, it won't be evaluated but remain data. If the latter appears (funcall HERE), for example, then that will still work, because there is a special case somewhere that wo…

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@tarsius
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by tarsius
Comment options

You must be logged in to vote
1 reply
@tarsius
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants