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

Re: Control Structures II: loop

Thread Previous | Thread Next
From:
Timothy S. Nelson
Date:
February 12, 2005 04:14
Subject:
Re: Control Structures II: loop
Message ID:
Pine.LNX.4.44.0502121459430.6484-100000@elphin.nelson.org.au
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:
> > http://www.nondot.org/sabre/Mirrored/AdvProgLangDesign/
>
> 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

http://www.info.univ-angers.fr/pub/gh/wAides/sax6_userdoc.pdf
	Look under Language Guide/Operators.  

	:)


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayland@smartchat.net.au | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
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-
-----END GEEK CODE BLOCK-----

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About