develooper Front page | perl.perl6.language | Postings from May 2001

Re: 1 until defined(getvalue()); return it;

Thread Previous | Thread Next
From:
Buddha Buck
Date:
May 30, 2001 10:57
Subject:
Re: 1 until defined(getvalue()); return it;
Message ID:
5.0.2.1.0.20010530135927.02c2d1b0@128.205.32.3
At 06:54 PM 05-30-2001 +0100, Michael G Schwern wrote:
>On Wed, May 30, 2001 at 12:38:50PM -0500, David L. Nicol wrote:
> > while pseudocoding something I realized that it would be really
> > cool if there was another magical default shelf, like $_  or _ but
> > subtly different, that stores, if lexically used, the object of the
> > most recent "defined" or "exists" --
> >
> > or maybe even the most recently referred to scalar, just the way
> > "it" works in English.  "it" would change much more often than $_
> > does.
>
>*quiver* Please god no.  Its difficult enough to follow the twists and
>abuses of $_ when reading code.
>
>That aside, could you put together a code example of what this wins?

I'd be interested in seeing how "it" would be better than what works now.

Why is:

1 until defined(getvalue()); return it;

better than

1 until defined($foo=getvalue()); return foo;

?




>--
>
>Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
>Perl6 Quality Assurance     <perl-qa@perl.org>       Kwalitee Is Job One
>Death follows me like a wee followey thing.
>         -- Quakeman


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About