Re: Angle quotes and pointy brackets

2004-12-03 Thread Larry Wall
On Thu, Dec 02, 2004 at 09:15:50PM -0800, Larry Wall wrote: : On Thu, Dec 02, 2004 at 02:54:42PM -0700, John Williams wrote: : : Does / -alpha / capture to $0{'-alpha'} ? : : Or should that be written / -«alpha» / ? : : At the moment I've got it that only assertions of the form word capture.

Re: Angle quotes and pointy brackets

2004-12-03 Thread Brent 'Dax' Royal-Gordon
Larry Wall [EMAIL PROTECTED] wrote: Speaking of at the moment, I just now updated the Synopses at dev.perl.org. The new S2 says: # Heredocs are no longer written with , but with an adverb on any other # quote construct: # # print qq:to/END/ # Give $amount to the man behind curtain

Re: Angle quotes and pointy brackets

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 12:56:18AM -0800, Brent 'Dax' Royal-Gordon wrote: : Larry Wall [EMAIL PROTECTED] wrote: : Speaking of at the moment, I just now updated the Synopses at : dev.perl.org. : : The new S2 says: : # Heredocs are no longer written with , but with an adverb on any other : #

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

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 09:31:33AM -0800, Larry Wall wrote: : I guess the only real argument against unifying is that neither of : : for [EMAIL PROTECTED] {...} : : or : : for @foo {...} : : indicate destructive readout. Which probably says that * : is the wrong operator to use for

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

2004-12-03 Thread Herbert Snorrason
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. Replacing that with something that not only is object oriented, but on top of that also LOOKS object oriented is bound to be a loss. It's going to be that bit

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

2004-12-03 Thread John Siracusa
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 setters. So in Java, you might as well get the chore out of the way up front. In

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

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 and change

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 course

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 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

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? list of words» «list of words Just thinking... Richard -- Personal [EMAIL PROTECTED]http://www.waveney.org Telecoms [EMAIL PROTECTED]

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

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

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

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

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

flip flop 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: flip flop 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 it

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 best way to

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: 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 setters. So

Re: flip flop 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

Re: flip flop 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 least

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 that

Re: flip flop 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

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_000

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

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 that there

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: 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 if 0;