Re: state vs my

2004-12-03 Thread Brent 'Dax' Royal-Gordon
Larry Wall <[EMAIL PROTECTED]> wrote: > So optimizing to a state variable won't necessarily help your loop > overhead, but it could help your subroutine overhead, at least in Perl > 5, if Perl 5 had state variables. Best you can do in Perl 5 is an > "our" variable with an obscure name. my $x

Re: state vs my

2004-12-03 Thread Larry Wall
On Sat, Dec 04, 2004 at 06:31:35AM +0300, Alexey Trofimenko wrote: : : for 1..10_000_000 { : my ($a,$b,$c) = ... : ... : } : : vs. : : for 1..10_000_000 { : state ($a,$b,$c) = ... : ... : } : : latter looks like it would run faster, because no reallocation envolved

Re: Angle quotes and pointy brackets

2004-12-03 Thread Matt Diephouse
On Tue, 30 Nov 2004 14:58:13 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: > But then it's not a general iterator iterator. Plus it has the Unicode > taint... > > Back to reality, another thought to weave in here is that something > like > > for $iterator.each -> $x {...} > > might specify

state vs my

2004-12-03 Thread Alexey Trofimenko
for 1..10_000_000 { my ($a,$b,$c) = ... ... } vs. for 1..10_000_000 { state ($a,$b,$c) = ... ... } latter looks like it would run faster, because no reallocation envolved here. I've read an advice somewhat like that in Ruby docs, tried it on perl5, and it really make

Re: temp $var;

2004-12-03 Thread Larry Wall
On Sat, Dec 04, 2004 at 06:01:45AM +0300, Alexey Trofimenko wrote: : : my $var="foo"; : { : temp $var; : say $var; : } : : would it be undef or "foo"? It's undef if we follow Perl 5. (Early Perls actually kept the original value, but that was deemed improper at some point.) : if

temp $var;

2004-12-03 Thread Alexey Trofimenko
my $var="foo"; { temp $var; say $var; } would it be undef or "foo"? if the former, how could I make $var to contain a copy of original content? using analogy with my $x = $x, that's not going to work.. temp $var = $OUTER::var? OTOH, my @a = ... # something not lazy with 10_000_

[PATCH]

2004-12-03 Thread Garrett Rooney
This patch fixes some warnings in global_setup.c and embed.c. All it does is add some necessary includes to pick up function declarations and constify a variable to avoid warnings about casting from const to non-const, so it should be pretty safe to apply. -garrett Index: src/embed.c =

Re: xx Inf

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 05:37:54PM -0700, Luke Palmer wrote: : Juerd writes: : > What happens to the flip flop operator? Will .. in scalar context : > remain the same? What comes in place of ...? (An adverb?) : : The scalar range operator was always a weird one for me, but that isn't : to say that

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 06:43:05PM +, Herbert Snorrason wrote: : This whole issue kind of makes me go 'ugh'. One of the things I like : best about Perl is the amazing simplicity of the <> input construct. Hmm. while (<>) {...} for .lines {...} Looks like a wash to me. : Replacing th

Re: xx Inf

2004-12-03 Thread Jon Ericson
Luke Palmer <[EMAIL PROTECTED]> writes: > Juerd writes: >> What happens to the flip flop operator? Will .. in scalar context >> remain the same? What comes in place of ...? (An adverb?) > Anyway, to answer what I _do_ know, isn't .. exactly the same as ... in > Perl 5? That was my impression, at

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Mark J. Reed
On 2004-12-03 at 14:46:16, John Siracusa wrote: > Anyway, I thought it was interesting to see the ease of "forward > compatibility" for simple attributes touted as a feature of Python. I'd > like to tout it as a feature of Perl 6 too, because I also hate writing > getters and setters... :) Amen.

Re: xx Inf

2004-12-03 Thread Larry Wall
On Sat, Dec 04, 2004 at 01:11:30AM +0100, Juerd wrote: : What happens to the flip flop operator? Will .. in scalar context remain : the same? I don't think so. It's definitely a candidate for a longer Huffmanization simply in terms of frequency of use. On top of which, almost no Perl 5 programme

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Paul Johnson
On Fri, Dec 03, 2004 at 02:05:16PM -0500, John Siracusa wrote: > >From http://dirtsimple.org/2004/12/python-is-not-java.html > > "In Java, you have to use getters and setters because using public fields > gives you no opportunity to go back and change your mind later to using > getters and setter

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Luke Palmer
John Siracusa writes: > I guess I wasn't asking if it would be "possible" (I think that's been > established), but if it would be "easy", "reasonable", or "clean" (as > it appears to be in Python, although I'm just going by what the quoted > web page says). I recall some discussions about the "bes

Re: xx Inf

2004-12-03 Thread Luke Palmer
Juerd writes: > What happens to the flip flop operator? Will .. in scalar context > remain the same? What comes in place of ...? (An adverb?) The scalar range operator was always a weird one for me, but that isn't to say that it hasn't been put to good use by wizards. I wouldn't be surprised if i

xx Inf

2004-12-03 Thread Juerd
What happens to the flip flop operator? Will .. in scalar context remain the same? What comes in place of ...? (An adverb?) Juerd

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 04:13:01PM -0500, John Siracusa wrote: : On Fri, 3 Dec 2004 22:06:43 +0100, Paul Johnson <[EMAIL PROTECTED]> wrote: : > http://www.nntp.perl.org/group/perl.perl6.language/9576 : : Wow, that's a blast from the past. I wonder how much of it is still : valid... :) Almost all

Re: specifying the key Type for a Hash

2004-12-03 Thread Abhijit Mahabal
On Fri, 3 Dec 2004, Larry Wall wrote: : None of the synopses have anything like this. S6 talks about the : types of values, but not keys. Oversight, or is this syntax dead? S9 talk about it. Oops. Sorry. So it was oversight after all :) --abhijit Abhijit Mahabal http://www.cs.indiana.edu/~amah

Re: specifying the key Type for a Hash

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 05:23:56PM -0500, Abhijit Mahabal wrote: : A6 included examples of syntax for specifying the type of the key for a : hash: : : my %pet is Hash(keytype => Str, returns => Cat) : : None of the synopses have anything like this. S6 talks about the : types of values, but not

specifying the key Type for a Hash

2004-12-03 Thread Abhijit Mahabal
A6 included examples of syntax for specifying the type of the key for a hash: my %pet is Hash(keytype => Str, returns => Cat) None of the synopses have anything like this. S6 talks about the types of values, but not keys. Oversight, or is this syntax dead? --abhijit Abhijit Mahabal http://

Re: Yet more on angle quotes

2004-12-03 Thread Juerd
Richard Proctor skribis 2004-12-03 21:27 (+): > How equivalent are << and «? This question has already been asked. See message <[EMAIL PROTECTED]>. Juerd

Yet more on angle quotes

2004-12-03 Thread Richard Proctor
How equivalent are << and «? Does use of one idiom imply the closing quote is the same. ie are the following allowed, prohibited or what? <> Just thinking... Richard -- Personal [EMAIL PROTECTED]http://www.waveney.org Telecoms [EMAIL PROTECTED] http://www.WaveneyConsult

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread John Siracusa
On Fri, 3 Dec 2004 22:06:43 +0100, Paul Johnson <[EMAIL PROTECTED]> wrote: > http://www.nntp.perl.org/group/perl.perl6.language/9576 Wow, that's a blast from the past. I wonder how much of it is still valid... :) -John

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Juerd
Juerd skribis 2004-12-03 21:09 (+0100): > $foo.bar .= "foo" Meant ~= there. Juerd

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Juerd
John Siracusa skribis 2004-12-03 14:46 (-0500): > Anyway, I thought it was interesting to see the ease of "forward > compatibility" for simple attributes touted as a feature of Python. I'd > like to tout it as a feature of Perl 6 too, because I also hate writing > getters and setters... :) Of cou

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread John Siracusa
On Fri, 3 Dec 2004 20:37:40 +0100, Juerd <[EMAIL PROTECTED]> wrote: > John Siracusa skribis 2004-12-03 14:05 (-0500): >> From http://dirtsimple.org/2004/12/python-is-not-java.html >> >> "In Java, you have to use getters and setters because using public fields >> gives you no opportunity to go back

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Juerd
John Siracusa skribis 2004-12-03 14:05 (-0500): > I'd like to be able to s/Python/Perl 6/ above, but after many discussions on > this topic, I'm still not sure if I can. Anything can be anything. I'm sure that despite the ability to run all the code you want upon reading/writing an attribute, some

perlhash iter busted

2004-12-03 Thread Sam Ruby
Test case attached. - Sam Ruby Index: t/pmc/perlhash.t === RCS file: /cvs/public/parrot/t/pmc/perlhash.t,v retrieving revision 1.48 diff -u -r1.48 perlhash.t --- t/pmc/perlhash.t1 Oct 2004 21:16:52 - 1.48 +++ t/pmc/perlha

[ANNOUNCE] CPANPLUS-0.050_01

2004-12-03 Thread Jos I. Boumans
Greetings, After a prolonged period of merely bugfixes, this day marks the release of a new feature release (and ground up rewrite) of CPANPLUS: 0.050_01 This feature release prepares us for the next line of plugins in CPANPLUS, which should greatly improve the quality of code and use of CPAN an