Re: Cmap Cgrep and lazyness

2004-07-03 Thread Luke Palmer
Alexey Trofimenko writes: what I want to ask - would map and grep return an iterators too?.. if it's true, then previous construct becames very memory efficient, like if I write loop ( ... ; ... ; ... ) {...; next if ...; ...; say} Yep, they will. hm.. It could be a little too

Re: push with lazy lists

2004-07-03 Thread Dan Hursh
Joseph Ryan wrote: The way I understand the magicness of lazy lists, I'd expect: @x = 3..Inf; say pop @x; # prints Inf @x = 3..Inf; push @x, 6; # an array with the first part being # lazy, and then the element 6 say pop @x; # prints 6 say pop @x; # prints Inf say pop @x; # prints Inf

Re: The .bytes/.codepoints/.graphemes methods

2004-07-03 Thread Brent 'Dax' Royal-Gordon
Aaron Sherman wrote: On Tue, 2004-06-29 at 11:34, Austin Hastings wrote: (2) Perl6 should equitably support all its target locales; (3) we should set out to make sure the performance is damn fast no matter what locale we're using. Well, that's a nice theory, but you can prove that low-level

Re: Cmap Cgrep and lazyness

2004-07-03 Thread Brent 'Dax' Royal-Gordon
Alexey Trofimenko wrote: apply to it perl6 GC, which wouldn't always free memory immediately, so it could eat 3_000_000 or more. Parrot runs a DOD (Dead Object Detection) sweep whenever its memory pools fill up, so this is probably a far smaller problem than you suggest. (If there still

Re: undo()?

2004-07-03 Thread Jonadab the Unsightly One
Juerd [EMAIL PROTECTED] writes: I thought temp replaced local. temp is dynamic scoping, the same thing as Perl5's local. Hypotheticals are the ones that turn permanent if everything succeeds according to plan but revert to the old value if stuff fails -- a rollback mechanism, basically. I

Re: undo()?

2004-07-03 Thread Jonadab the Unsightly One
Brent 'Dax' Royal-Gordon [EMAIL PROTECTED] writes: Actually, I think you're underestimating the little guys. After all, if they rolled back *all* of your changes, all they could do was repeatedly execute the same code! Except that you can pass the continuation some arguments, possibly

Re: if not C, then what?

2004-07-03 Thread Jonadab the Unsightly One
Jonathan Lang [EMAIL PROTECTED] writes: Strictly from a grammatical perspective, I'd be much more comfortable with C, then instead of Cthen as the perl equivelent of the C-style comma: have the then keyword change the preceeding comma from a list constructor to an expression combiner. From a

Re: if not C, then what?

2004-07-03 Thread Jonadab the Unsightly One
David Storrs [EMAIL PROTECTED] writes: e.g., is this legal? sub infix:before ( $before, $after ){ ... } I should HOPE it would be legal to define infix:before. Some of us don't want to use untypeable characters every time we want to define an operator that doesn't conflict with the core

Re: if not C, then what?

2004-07-03 Thread Jonadab the Unsightly One
Jonathan Lang [EMAIL PROTECTED] writes: For the record, I was mentally parsing this example as: pray_to $_; sacrifice $virgin for @evil_gods; So was I, FWIW. The precedence of Cthen isn't very intuitive to me. Is that an argument for changing its precedence, or for leaving it out

Re: if not C, then what?

2004-07-03 Thread Juerd
Jonadab the Unsightly One skribis 2004-07-03 13:33 (-0400): e.g., is this legal? sub infix:before ( $before, $after ){ ... } I should HOPE it would be legal to define infix:before. There already are infix:x and infix:xx. If Perl 6 will let us define our own operators just like built in ones,

Re: push with lazy lists

2004-07-03 Thread JOSEPH RYAN
- Original Message - From: Dan Hursh [EMAIL PROTECTED] Date: Friday, July 2, 2004 10:32 pm Subject: Re: push with lazy lists Joseph Ryan wrote: I guess that's true with X..Y lazy lists. I thought there were other ways to make lazy lists, like giving it a closure that gets called

Re: undo()?

2004-07-03 Thread Jonadab the Unsightly One
Luke Palmer [EMAIL PROTECTED] writes: Oh no! Someone doesn't understand continuations! How could this happen?! :-) Yes, well, I've only just started reading up on them recently... A continuation doesn't save data. It's just a closure that closes over the execution stack Ah. That helps

Re: Cmap Cgrep and lazyness

2004-07-03 Thread Luke Palmer
Brent 'Dax' Royal-Gordon writes: As you mentioned below, this causes problems if the code in question has side effects. But there are other cases where it messes up: sub even($_ = $CALLER::_) { ! $_ % 2 } my @e=grep { even() } 1..1024; #Okay, we don't need even anymore...