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.
Namelists or Structured Arguments?
- Dick Bowman
- Posts: 235
- Joined: Thu Jun 18, 2009 4:55 pm
- Contact:
Namelists or Structured Arguments?
Visit http://apl.dickbowman.com to read more from Dick Bowman
Re: Namelists or Structured Arguments?
Hi Dick,
I don't think this is a bad idea; in fact APL# is heading in this direction.
I have logged your suggestion as RFE[7368].
Here's a rather outrageous example of a 0-line tradfn to rotate a binary tree:
John.
I don't think this is a bad idea; in fact APL# is heading in this direction.
I have logged your suggestion as RFE[7368].
Here's a rather outrageous example of a 0-line tradfn to rotate a binary tree:
∇ (a(b c))←rrot((a b)c) ∇ ⍝ right-rotation of binary tree
(0 1)(2(3 4)) ≡ rrot ((0 1)2)(3 4)
1
John.