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'
--- 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
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
.
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
On Mon, 3 Feb 2003, Dave Mitchell wrote:
$var ??= 'succeeded' :: 'failed';
Aha!
$var 'succeeded' || 'failed';
Thank you, precedence.
/s
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
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
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
--- 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
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
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
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?
12 matches
Mail list logo