J
John-Mason P. Shackelford
As an alternative to:
a =3D y =3D=3D z ? b : c=20
we can say:
a =3D (b if y =3D=3D x) || c
Can anyone think of others?
I'd really like to be able to say:
a =3D b if y=3D=3Dz otherwise c
but the precedence of _or_ is not low enough for this to work. Would
changing the precedence of _or_ to be lower than expression modifiers
brake much? I believe _or_ is presently just above the expression
modifiers today. Then again perhaps that would be confusing. Perhaps
an _otherwise_ operator would do the trick.
This is trivial really, but ruby specializes in niceties which many
might deem trivial but which all add up to an amazingly productive
environment.
--=20
John-Mason Shackelford
Software Developer
Pearson Educational Measurement
2510 North Dodge St.
Iowa City, IA 52245
ph. 319-354-9200x6214
(e-mail address removed)
http://pearsonedmeasurement.com
a =3D y =3D=3D z ? b : c=20
we can say:
a =3D (b if y =3D=3D x) || c
Can anyone think of others?
I'd really like to be able to say:
a =3D b if y=3D=3Dz otherwise c
but the precedence of _or_ is not low enough for this to work. Would
changing the precedence of _or_ to be lower than expression modifiers
brake much? I believe _or_ is presently just above the expression
modifiers today. Then again perhaps that would be confusing. Perhaps
an _otherwise_ operator would do the trick.
This is trivial really, but ruby specializes in niceties which many
might deem trivial but which all add up to an amazingly productive
environment.
--=20
John-Mason Shackelford
Software Developer
Pearson Educational Measurement
2510 North Dodge St.
Iowa City, IA 52245
ph. 319-354-9200x6214
(e-mail address removed)
http://pearsonedmeasurement.com