On Mon, Apr 19, 2004 at 01:06:29AM -0600, Luke Palmer wrote:
: Therefore, the first syntax can be redefined to evaluate the code block
: and assign the result to $0. The example now becomes:
:
: rule list {
: ?term , ?list { make_node('list', $?term, $?list) }
: | ?term
Luke Palmer writes:
{ get_rule() }# call an anonymous rule returned by the code block
Can also be written:
$( get_rule() )
Therefore, the first syntax can be redefined to evaluate the code block
and assign the result to $0. The example now becomes:
rule list {
On Apr 19, 2004, at 12:06 AM, Luke Palmer wrote:
Therefore, the first syntax can be redefined to evaluate the code block
and assign the result to $0.
Would you ever want to leave $0 unaltered? That's the only concern
which comes to mind.
My argument for using this notation stems from the fact
Jeff Clites writes:
On Apr 19, 2004, at 12:06 AM, Luke Palmer wrote:
Therefore, the first syntax can be redefined to evaluate the code block
and assign the result to $0.
Would you ever want to leave $0 unaltered? That's the only concern
which comes to mind.
Absoultely: if you want
I notice that when I write a grammar, I end up doing this an awful lot
(in P::RD notation):
list: term ',' list { make_node(@item[0,1,3]) }
| term { $item[1] }
With attention on the actions, and assuming autotree is on.
In Perl 6, aside from the fact that there's a clearly