Namelists or Structured Arguments?
Posted: Mon Jun 13, 2011 10:42 am
This is something that I seem to think could be useful from time to time, and I need reminding why it's a bad idea...
At present we can specify defined function right arguments and results as (flat) namelists. Hence
(a b c)←foo(x y z)
is a valid function header.
But there's a more flexible opportunity for individual statements...
a(b c)←1 (2 3)
Since namelist-as-right-argument saves us the tedium of unpicking a list of names, I'm wondering (because I just wanted to do it) whether we might also benefit by being able to put a nesting structure into defined function argument and result headers, as in
(a (b c))←foo(x (y z))
I'm sure we've been down this route before and I just need reminding why it's a really stupid idea. I can already see that it's "limited" - but I do think it might sometimes be useful.
At present we can specify defined function right arguments and results as (flat) namelists. Hence
(a b c)←foo(x y z)
is a valid function header.
But there's a more flexible opportunity for individual statements...
a(b c)←1 (2 3)
Since namelist-as-right-argument saves us the tedium of unpicking a list of names, I'm wondering (because I just wanted to do it) whether we might also benefit by being able to put a nesting structure into defined function argument and result headers, as in
(a (b c))←foo(x (y z))
I'm sure we've been down this route before and I just need reminding why it's a really stupid idea. I can already see that it's "limited" - but I do think it might sometimes be useful.