develooper Front page | perl.perl6.language | Postings from February 2005

Re: Control Structures II: loop

Thread Previous | Thread Next
Timothy S. Nelson
February 12, 2005 04:14
Re: Control Structures II: loop
Message ID:
On Thu, 14 Nov 2002, Luke Palmer wrote:

> > nest:
> > 	Nest is the power loop thingy documented in Raphael Finkel's top notch 
> > book "Advanced Programming Language Design", near the end of the "Control 
> > Structures" chapter -- this book is in PDF format:
> >
> The only thing it doesn't cover is C<nest>, which, in practical
> situations, isn't all that useful anyway.  It's cleaner just to nest
> manually. 

In 2002, I said: 
        As the Finkel book points out, that only works if you know ahead of 
time how many layers deep you're going to be nesting.  Personally, I don't 
expect to need nest more than once or twice in my life, but it'd be useful for 
the times it's needed.  

Now I add:
	I knew there was a situation where these are useful, and I've found 
it, and it'll probably be more frequent in Perl6 than Perl5: recursing through 
multidimensional arrays where you don't know how many dimensions there are.  
For example, nest would be great for implementing some of the APL operators.  
Just fors the record:
Perl		APL
Operators	Functions
Hyper-operators	Operators
	Look under Language Guide/Operators.  


| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: | I am                           |

Version 3.12
GCS d+ s:- a- C++>++++$ U++ P++ L++ E- W+++ N+ w>--- V- Y+>++ 
PGP->++ R !tv b++ DI++++ D+ G e++>++++ h! y-

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About