Re: feature req: passing sequences
- Posted by petelomax Feb 14, 2015
- 1500 views
Now, what about more complicated situations?
foo( bar, param_unroll( baz ), bat, param_unroll( blat), junk )
Seems a little overkill to me. Would there be the problem with forcing a single unroll?
foo( param_unroll( bar & baz & bat & blat & junk ))
That might better allow re-use of some of the existing code in call_func/proc.
position( param_unroll( junk ))
Just to throw some random ideas about, maybe something a bit more minimalist like
position( @junk )
or some other [new] operator to signify desequencing, :{}junk, =:junk, :=:junk, ()junk, []junk, {}junk, to list a few possibilities.
An alternative and probably far better solution might be to make routine_id("") optional on the first parameter of call_func/proc, eg:
call_proc(position,junk)
with the bonus of seamlessly supporting those builtins for which routine_id does not currently work. Before anyone jumps the gun here, that does not mean you can actually have a routine_id for a builtin (write a tiny wrapper you lazy sod!), nor does it mean it will actually invoke call_proc/func. It would also require the routine identifier to resolve at parse-time, not run-time.
Now that I've said it I rather suspect that is much closer to what the real problem is, and you can probably forget that nonsense above about a new minimalist desequence operator?
Pete