Re: Shortcut: ?=

2003-02-04 Thread John Williams
What about: ($var = 'succeeded') ||= 'failed'; On Mon, 3 Feb 2003, Sean O'Rourke wrote: Argh. Please disregard that last message as the ramblings of a pre-caffeinated mind. /s On Mon, 3 Feb 2003, Sean O'Rourke wrote: On Mon, 3 Feb 2003, Dave Mitchell wrote: $var ??= 'succeeded'

Re: Shortcut: ?=

2003-02-03 Thread Austin Hastings
--- Miko O'Sullivan [EMAIL PROTECTED] wrote: SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So

Re: Shortcut: ?=

2003-02-03 Thread Dave Mitchell
On Mon, Feb 03, 2003 at 06:25:09AM -0800, Austin Hastings wrote: The only time this doesn't change type (arguably a bad thing in its own right) is when you're doing boolean ops. And for those, there exist boolean operators. Changing type is a very Perlish thing to do. How 'bout a shortcut

Re: Shortcut: ?=

2003-02-03 Thread Miko O'Sullivan
. Obviously this isn't a major requirement. It's just a nice little shortcut that would clean the code in the same way the other shortcuts do. I always feel somehow redundant type C$var = $var ? 1 : 0, and ??= would just be nice and tidy. -miko Miko O'Sullivan Programmer Analyst Rescue Mission

Re: Shortcut: ?=

2003-02-03 Thread Sean O'Rourke
On Mon, 3 Feb 2003, Dave Mitchell wrote: $var ??= 'succeeded' :: 'failed'; Aha! $var 'succeeded' || 'failed'; Thank you, precedence. /s

Re: Shortcut: ?=

2003-02-03 Thread Sean O'Rourke
Argh. Please disregard that last message as the ramblings of a pre-caffeinated mind. /s On Mon, 3 Feb 2003, Sean O'Rourke wrote: On Mon, 3 Feb 2003, Dave Mitchell wrote: $var ??= 'succeeded' :: 'failed'; Aha! $var 'succeeded' || 'failed'; Thank you, precedence. /s

Re: Shortcut: ?=

2003-02-03 Thread Deborah Ariel Pickett
I guess what I'm saying is that someone needs to provide a real-world, non-contrived, example showing ??= in use. Fair enough. Real World, Non-Contrived: In all databases that I've ever worked with there are exactly two possible values for a boolean database field. Those two values are

Shortcut: ?=

2003-02-02 Thread Miko O'Sullivan
SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So, concerning C? :, I find myself doing this type of thing a lot

Re: Shortcut: ?=

2003-02-02 Thread Mr. Nobody
--- Miko O'Sullivan [EMAIL PROTECTED] wrote: SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So, concerning

Re: Shortcut: ?=

2003-02-02 Thread Deborah Ariel Pickett
SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So, concerning C? :, I find myself doing this type of thing a lot

Re: Shortcut: ?=

2003-02-02 Thread Joseph F. Ryan
Miko O'Sullivan wrote: SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So, concerning C? :, I find myself doing

Re: p6 casting as shortcut for lengthier p5 syntax

2001-05-11 Thread Larry Wall
David L. Nicol writes: : Demonstrating, the p5 cast can be performed. I guess p6 will : optimize any @{[...]} constructions into @(...) but still accept : it as valid, deprecated syntax? Why should it be deprecated? Oh, are you wondering because I said that @{foo[bar]} was no longer valid?