On Wed, May 30, 2001 at 06:58:50PM -0500, David L. Nicol wrote:
> > Of course, 'sub it():lvalue{$_}' gets you *most* of the benefit.
> ^^
You see that word? You know what it means?
> I want to buy the code, as listed in the code table, not the food
Simon Cozens wrote:
>
> On Wed, May 30, 2001 at 06:48:53PM +0100, Simon Cozens wrote:
> > *Nice*, but potentially a bugger to implement.
>
> Of course, 'sub it():lvalue{$_}' gets you *most* of the benefit.
um, no.
foreach(@foods){
# okay, I'll try...
ex
David wrote:
>defined $thing and return $thing
Why not use the existing mechanism? Namely:
return $_ for grep{defined} $thing;
which also scales rather nicely:
return $_ for grep{defined} $thing, $otherthing, $somethingelse;
As for the original problem of:
1
David L. Nicol wrote:
> some expressiveness is gained, and a creation of a temporary variable
> can be avoided.
>
> when $thing is a complex expression, a temporary variable must be
> explicitly assigned. "it" holds the place in my pseudocode.
If you have a complex expression, there's no way to
On Wed, May 30, 2001 at 06:48:53PM +0100, Simon Cozens wrote:
> *Nice*, but potentially a bugger to implement.
Of course, 'sub it():lvalue{$_}' gets you *most* of the benefit.
--
The complex-type shall be a simple-type. ISO 10206:1991 (Extended Pascal)
On Wed, May 30, 2001 at 02:54:27PM -0500, David L. Nicol wrote:
> small incremental improvement to [read|writ]ability
>
> writability:
>
> one less variable name to have to remember not to collide with
I think you have this one backwards. This is one giant, ambiguous
global variable whose valu
On Wed, May 30, 2001 at 02:39:57PM -0500, David L. Nicol wrote:
> ...
> defined $thing and return $thing
> ...
>
> when $thing is a complex expression, a temporary variable must be
> explicitly
> assigned. "it" holds the place in my pseudocode.
Hmmm, if $thing is a complex ex
Buddha Buck wrote:
> Why is [...] better than
>
> 1 until defined($foo=getvalue()); return $foo;
small incremental improvement to [read|writ]ability
writability:
one less thing to write
one less variable name to have to remember not to collide with
readability:
keyword "it" means look at v
Michael G Schwern wrote:
> That aside, could you put together a code example of what this wins?
some expressiveness is gained, and a creation of a temporary variable
can be avoided.
...
defined $thing and return $thing
...
is my working idiom for checking which case
Simon Cozens wrote:
> semantic ambiguity in there if you look hard enough, but
> can't come up with any example off hand.
I think I don't like the proposition that "it"
refer to the most recent *lexically* referenced scalar.
For example, in
$x ? $y : $z;
I think "it" should refer to whichever
Simon Cozens wrote:
> $foo = 5;
> print it + ($bar = 10) + it;
>
> 20 or 25?
or 30?
--
John Porter
On Wed, May 30, 2001 at 02:00:59PM -0400, Buddha Buck wrote:
> 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;
Done properly, it would have to be
On Wed, May 30, 2001 at 06:48:53PM +0100, Simon Cozens wrote:
> *Nice*, but potentially a bugger to implement. I'm also sure you
> can find semantic ambiguity in there if you look hard enough, but
> can't come up with any example off hand.
$foo = 5;
print it + ($bar = 10) + it;
20 or 25?
--
"E
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 l
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 "e
On Wed, May 30, 2001 at 12:38:50PM -0500, David L. Nicol wrote:
> or maybe even the most recently referred to scalar, just the way
> "it" works in English. "it" would change much more often than $_
> does.
*Nice*, but potentially a bugger to implement. I'm also sure you
can find semantic ambigui
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
Me wrote:
>
> It was an informal finger-in-the-wind thing I sent to
> a perl beginners list. Nothing special, just a quick
> survey.
>
> http://www.self-reference.com/cgi-bin/perl6plurals.pl
>
> > I certainly do not see that many people on the
> > list agreeing with you.
>
> And that means I s
18 matches
Mail list logo