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

2001-06-02 Thread David Grove
> "Where's the likes of David Grove when you need one?" I don't even know what you're talking about. Leave me alone. I'm learning Python... again. p

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

2001-05-31 Thread Vijay Singh
>> On Wed, May 30, 2001 at 06:48:53PM +0100, Simon Cozens wrote: >> Of course, 'sub it():lvalue{$_}' gets you *most* of the benefit. > > um, no. > >> You see that word? You know what it means? The "word" you *highlighted* was "of", as in "Of course". A non-sequitor, but your meaning is cl

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

2001-05-30 Thread Simon Cozens
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

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

2001-05-30 Thread David L. Nicol
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

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

2001-05-30 Thread Damian Conway
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

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

2001-05-30 Thread John Porter
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

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

2001-05-30 Thread Simon Cozens
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)

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

2001-05-30 Thread Michael G Schwern
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

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

2001-05-30 Thread Michael G Schwern
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

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

2001-05-30 Thread David L. Nicol
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

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

2001-05-30 Thread David L. Nicol
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

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

2001-05-30 Thread John Porter
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

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

2001-05-30 Thread John Porter
Simon Cozens wrote: > $foo = 5; > print it + ($bar = 10) + it; > > 20 or 25? or 30? -- John Porter

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

2001-05-30 Thread Michael G Schwern
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

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

2001-05-30 Thread Simon Cozens
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

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

2001-05-30 Thread Buddha Buck
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

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

2001-05-30 Thread Michael G Schwern
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

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

2001-05-30 Thread Simon Cozens
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