Re: feature req: passing sequences

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...

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.

mattlewis said...
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu