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
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
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
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
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
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_
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
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
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
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
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
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.
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
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
What happens to the flip flop operator? Will .. in scalar context remain
the same? What comes in place of ...? (An adverb?)
Juerd
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
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
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
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://
Richard Proctor skribis 2004-12-03 21:27 (+):
> How equivalent are << and «?
This question has already been asked. See message
<[EMAIL PROTECTED]>.
Juerd
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
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
Juerd skribis 2004-12-03 21:09 (+0100):
> $foo.bar .= "foo"
Meant ~= there.
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
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
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
>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
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 lo
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 tha
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
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
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 / <-> / capture to $0{'-'} ?
: : Or should that be written / <-«alpha»> / ?
:
: At the moment I've got it that only assertions of the form capture.
Which is a bit
32 matches
Mail list logo