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

Re: Look-ahead arguments in for loops

Thread Previous | Thread Next
From:
Damian Conway
Date:
October 1, 2005 17:21
Subject:
Re: Look-ahead arguments in for loops
Message ID:
433F27DE.7040809@conway.org
Austin Hastings wrote:

>>>1. Requirement to repeat the possibly complex expression for the list.
>>>2. Possible high cost of generating the list.
>>>3. Possible unique nature of the list.
> 
> The subroutine addresses #1, but not 2 or 3.

It does address 2. The list is generated once (wherever) and only passed to 
the subroutine once. No regeneration required. It's exactly like your "all but 
illegible" solution, just factored out and deuglified.

Since I don't understand what you mean by 3, I can't really judge whether it 
addresses it. But I *can* say it addresses it exactly as well as your "all but 
illegible" solution did.


> Also, there's a #4: modified state, which is hinted at but not really
> covered by #3.

4 is not possible using the pointy sub syntax in any form, since all params to 
pointy subs are always constant aliases.

Damian

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