Front page | perl.perl6.language |
Postings from December 2004
Re: state vs my
Thread Previous
|
Thread Next
From:
Michele Dondi
Date:
December 10, 2004 05:14
Subject:
Re: state vs my
Message ID:
Pine.LNX.4.61.0412091010441.7697@leia.pcteor1.mi.infn.it
On Fri, 3 Dec 2004, Brent 'Dax' Royal-Gordon wrote:
> Larry Wall <larry@wall.org> 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;
>
> I know it's *going* away, but it hasn't *gone* away yet.
Personally I'm glad this is going away. I'm not bothered by the caveats of
the docs: it's the construct itself that somehow strikes me as
"innatural", to the point that I've never been bitten in the neck by using
it inadvertently for I would have never ever though about doing so...
In fact a declaration is fundamentally a way to introduce an "object" to
be used subsequently, and the fact that it can be used also in the same
statement in which it is declared doesn't make things really different. So
how can I *declare* something depending on a condition?!? I can branch
over a condition to execute either one block or another *within* which
things can be declared or some such. Not the other way round...
Michele
--
>A question out of curiousity: who is this Green of Green's functions?
>Is he the same person of Green's theorem? :)
Yes. He was also an early environmentalist; hence the current
phrases "green" this and "green" that...
- David C. Ullrich on sci.math, thread "Who is Green?"
Thread Previous
|
Thread Next