Re: adverbial form of Pairs notation question

2008-09-08 Thread Damian Conway
On Sat, Sep 06, 2008 at 07:06:30PM +1100, Илья wrote: : Hello there, : what :foo should exactly produce? : At first I was expecting: : foo = : but in Rakudo: : foo = [] : and it looks like the right thing on the other hand. At YAPC::EU I pointed out to Larry that we have an adverbial form that

Re: adverbial form of Pairs notation question

2008-09-08 Thread TSa
HaloO, Brandon S. Allbery KF8NH wrote: On 2008 Sep 6, at 13:57, Larry Wall wrote: But basically I think NIL is a mild form of failure anyway, so it's fine with me if () is a form of failure that is smart enough to be I'm thinking () is the non-scalar (list, array, capture, maybe hash)

Re: adverbial form of Pairs notation question

2008-09-08 Thread TSa
HaloO, Larry Wall wrote: As mentioned on irc, it should do the same thing as foo = (). The question is whether () in item context promotes to []. I don't think it ought to, since () is really the only way we have of writing NIL in Perl 6, and [] isn't really NIL. And I think it would be odd

Re: adverbial form of Pairs notation question

2008-09-08 Thread Mark J. Reed
On Mon, Sep 8, 2008 at 11:08 AM, TSa [EMAIL PROTECTED] wrote: Sorry, what am I missing that I see no problem with List always itemizing to an Array? A List *does* always itemize to an Array. But parens do not a List make; the discontinuity mentioned is syntactic. (1,2,3) # (or longer) List

[PATCH] How to match against a grammar

2008-09-08 Thread Moritz Lenz
Hi, we had the discussion a few times on how to match against a grammar, for example here: http://irclog.perlgeek.de/parrot/2008-05-31#i_322490 Attached patch adds the $string ~~ Grammar.new form to S05, on which @Larry.pick($some) seems to have agreed upon. In the end I don't really care how

Re: adverbial form of Pairs notation question

2008-09-08 Thread TSa
HaloO, Damian Conway wrote: At YAPC::EU I pointed out to Larry that we have an adverbial form that defaults to true: :foo For orthogonality and clarity purposes this could also be written :?foo and one that defaults to false: :!foo but none that defaults to undef. After

Re: adverbial form of Pairs notation question

2008-09-08 Thread Jon Lang
TSa wrote: Ahh, I see. Thanks for the hint. It's actually comma that builds lists. So we could go with () for undef and require (1,) and (,) for the single element and empty list respectively. But then +(1,2,3,()) == 4. Actually, note that both infix:, and circumfix:[ ] can be used to build

Re: adverbial form of Pairs notation question

2008-09-08 Thread Mark J. Reed
On Mon, Sep 8, 2008 at 1:29 PM, Jon Lang [EMAIL PROTECTED] wrote: TSa wrote: Ahh, I see. Thanks for the hint. It's actually comma that builds lists. So we could go with () for undef and require (1,) and (,) for the single element and empty list respectively. But then +(1,2,3,()) == 4.

Re: How do you do a lazy map?

2008-09-08 Thread Larry Wall
Moritz Lenz moritz-at-casella.verplant.org |Perl 6| wrote: map *is* lazy, as are all list builtins that can be lazy (which doesn't include stuff like sort, which has to look at all items anyway). Well, sure, but it can be lazy about finding the ordering of the remaining elements, if you only

insight into laziness, background processing, etc.

2008-09-08 Thread John M. Dlugosz
While pondering whether or not the 'map' function is lazy, I had a flash of insight. Let's assume that it is, and go with an example of @results = map { process_item($_) } @files; Now ponder the questions of how independent are the iterations of the block. Must it