Skip to content
Prev 169075 / 398506 Next

sub question

Peter Dalgaard wrote:
if it is a name, how would you descend?  shouldn't the envisaged rule be
like:

when examining an operator expression,
(a) descend if it is a compound expression
(b) skip if it is a name

then 'foo(bar)()' would decompose to:

[('foo(bar)', '()']
[['foo', 'bar'], []] # by descent
=> ['bar'] # skip 'foo'

where square brackets denote parse tree (first two lines) and the
resulting list of names (last line).  'foo' skipped as being a simple
name in an operator position.

not sure about '~', i guess this is just an operator in the example
above, so it's actually

`~`(, foo(bar) ())

and the rule applies similarly.
one legitimate reason is to keep the syntax/semantics clean (worship the
god of boring pedantry). 
be this not enough, a practical example could certainly be found, though
admittedly the above were made up for the discussion. 

vQ