Re: Iterating over complex structures

2005-12-25 Thread Rob Kinyon
On 12/22/05, Michele Dondi <[EMAIL PROTECTED]> wrote: > Suppose I want to navigate a tree and print out info contained in each of > its leaves along with info gathered from the position in the tree of the > list itself? Can I do it in a "universal" manner as hinted above that > would work for other

Re: Iterating over complex structures

2005-12-23 Thread Brad Bowman
Well, @Larry has been researching attribute grammars for a month or two now, which are an efficient (programmer-wise, not necessarily processor-wise) method for specifying computations over trees. The only syntax we've seen is that of Language::AttributeGrammar and TGE, whose roots come from UU

Re: Iterating over complex structures

2005-12-23 Thread Brad Bowman
But in Perl 5 to "navigate" complex structures one needs ad-hoc solutions. I wonder if something is planned in Perl 6 as a means to do that through a syntactically convenient construct with ad-hoc-isms pluggable in in the form of suitable hooks (e.g. .on_node( { code; ... } ), etc.) that woul

Re: Iterating over complex structures

2005-12-22 Thread Luke Palmer
On 12/22/05, Michele Dondi > Please do not ask me what I have in mind, for I'm > not really sure. Well, @Larry has been researching attribute grammars for a month or two now, which are an efficient (programmer-wise, not necessarily processor-wise) method for specifying computations over trees. Th

Iterating over complex structures

2005-12-22 Thread Michele Dondi
In Perl 5 C is quite natural for iterating over lists and arrays. C is preferred for filehandles. With lazy evaluation this difference has been eliminated in Perl 6 so that while still TMTOWTDI (TAEMWTDI!) this kind of iterations will be more consistent. But in Perl 5 to "navigate" complex str