The modern world of binding means this is the true and correct behavior:
>> x: 10 y: 20
>> eval collect [keep 'x keep '+ keep 'y]
** PANIC: no binding for x
If you want that to run, you can either bind the container so that it has a context to trickle down to the unbound elements:
>> eval $ collect [keep 'x keep '+ keep 'y]
== 30
Or you can leave the container unbound and put bindings on the individual elements.
>> eval collect [keep $ 'x, keep $ '+, keep $ 'y]
== 30
If you're dealing with a bindable non-quoted thing, then you can use a $ that is "tied" directly onto the element... a "binding quote":
>> eval collect [keep $x, keep $+, keep $y]
== 30
BUT Should We Have An English WORD! For "Bind Here"?
I have previously remarked that if $ didn't exist, this operation is so critical that it would deserve the name BIND as an arity-1 intrinsic:
>> eval bind collect [keep 'x keep '+ keep 'y]
== 30
>> eval collect [keep bind 'x, keep bind '+, keep bind 'y]
== 30
But that feels like it squanders the word, when a BIND dialect can do so much more.
Or Is It Not Squandering, but Tactical Marketing?
Perhaps having an arity-1 BIND meaning "bind here" as a complement to an arity-1 UNBIND can help make this more palatable in the English-like world?
![]()
Other Words For Arity-2 BINDing?
arity-2 BIND could be WITH as in @hiiamboris's proposal, and BIND could be arity-1 for this "clean" look, but I dunno.
Alternate Modality Of Arity-2 BIND?
I've suggested maybe a parameter to the arity-2 bind for the functionality:
>> make-bound: func [x] [return bind <here> '(x)]
But it would be a bit cluttered and couldn't be an intrinsic... so the benefits kind of drop off. I don't think it would make anyone who didn't like $ happy enough.