We have this thing now. It's called APPLY.
>> apply :add [10 20 1020]
** Error: Too many values in APPLY argument block (see /RELAX)
You have to explicitly tell it to /RELAX if you want it to ignore extra parameters.
>> apply/relax :add [10 20 1020]
== 30
With the infix quoting version, you can do this succinctly.
>> add // [10 20 1020]
** Error: Too many values in APPLY argument block (see /RELAX)
Stupid (?) Idea of the Moment
Make triple slash the relaxed form of APPLY
>> add /// [10 20 1020]
== 30
We don't technically need rebApply()
and rebApplyRelax()
(or rebApplyRelaxed()
?) in the API, but it could save on constructing a block for the apply parameters and give a little bit more efficiency to not need to look up the APPLY operator.
rebValue("apply", some_func, "[", arg1, arg2, arg3, "]");
rebApply(some_func, arg1, arg2, arg3);
It's probably worth it--we'll be needing all the performance tricks we can get.
We could soft quote the first slot so you could use WORD! or TUPLE! or CHAIN! or PATH! there.
rebApply("lib/append:dup", arg1, arg2, arg3);