C C and lazyness

2004-07-02 Thread Alexey Trofimenko
consider this: say for map {...} grep {...} map {...} 1..1_000_000 as far as I can imagine, in perl5 it does: 1)flatten 1..1_000_000 into anonimous array; (maybe in this particular case it is optimized in perl5, like it done in C.. I don't know.) 2)map trough it elements and store results in

Re: if not C<,> then what?

2004-07-02 Thread Luke Palmer
Alexey Trofimenko writes: > I remember perl5 scalar: > scalar($a, $b, $c) In Perl 6, I presume that means the same as: [ $a, $b, $c ] > hm.. sorry, scalar() isn't needed at all:) > > 2+(test,test,test) Likewise, this would be: 2+[test, test, test] Which should be: 2+3 Ass

Re: if not C<,> then what?

2004-07-02 Thread Alexey Trofimenko
On Thu, 1 Jul 2004 16:14:37 -0700 (PDT), Jonathan Lang <[EMAIL PROTECTED]> wrote: Actually, the whole purpose of the C-style comma is to allow you to place multiple expressions in a place that's only designed to take one, such as the various divisions within a loop control set ("loop ($i = 0, $j

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

2004-07-02 Thread Aaron Sherman
On Tue, 2004-06-29 at 11:34, Austin Hastings wrote: > [...] when you switch to LC_ALL= language>, you just get really slow performance: Apparently the 'C' > locale is such a totally special case that the performance of LC_ALL=C > is one or more orders of magnitude better than LC_ALL=en_US.UTF-8,

Re: push with lazy lists

2004-07-02 Thread JOSEPH RYAN
- Original Message - From: Dan Hursh <[EMAIL PROTECTED]> Date: Friday, July 2, 2004 2:23 pm Subject: push with lazy lists > Hi, > > If I can assume: > > @x = 3..5; > say pop @x;# prints 5 > > @x = 3..5; > push @x, 6; > say pop @x;# prints 6 >

push with lazy lists

2004-07-02 Thread Dan Hursh
Hi, If I can assume: @x = 3..5; say pop @x;# prints 5 @x = 3..5; push @x, 6; say pop @x;# prints 6 say pop @x;# prints 5 What should I expect for the following? @x = 3..Inf; say pop @x;# heat death?

Re: if not C<,> then what?

2004-07-02 Thread JOSEPH RYAN
- Original Message - From: David Storrs <[EMAIL PROTECTED]> Date: Thursday, July 1, 2004 7:55 pm Subject: Re: if not C<,> then what? > On Thu, Jul 01, 2004 at 04:14:37PM -0700, Jonathan Lang wrote: > > Juerd wrote: > > > > If you're really enamoured with the infix operator syntax, > cons

Re: undo()?

2004-07-02 Thread Brent 'Dax' Royal-Gordon
Rod Adams wrote: Well, that's another explanation that jives with my understanding of them. But I still don't have an idea of when I would actually want to use them in something I'm writing. You can use them to implement all sorts of interesting control flow constructs. For example, here's

Re: [perl #30560] [PATCH] classes/complex.pmc: void function can't return a value

2004-07-02 Thread Ion Alexandru Morega
Andy Dougherty wrote: The Solaris compiler complained when classes/complex.c tried to return a value from a void function. This patch assumes the function indeed is intended to be void and no return value is needed. You're right, it slipped. We really need compiler flags to catch these. Still, it

Re: if not C<,> then what?

2004-07-02 Thread David Storrs
On Thu, Jul 01, 2004 at 04:14:37PM -0700, Jonathan Lang wrote: > Juerd wrote: > > If you're really enamoured with the infix operator syntax, consider this > possibility: > > sub infix:-> ($before, $after) { > $before; # is this line redundant? > return $after; > } > print $

Re: [perl #30560] [PATCH] classes/complex.pmc: void function can't return a value

2004-07-02 Thread Leopold Toetsch
Andy Dougherty (via RT) wrote: The Solaris compiler complained when classes/complex.c tried to return a value from a void function. This patch assumes the function indeed is intended to be void and no return value is needed. Thanks, applied. leo