Case Range Statement ..
"Jérôme M. Berger"
jeberger at free.fr
Fri Jul 10 13:46:59 PDT 2009
Walter Bright wrote:
> Jérôme M. Berger wrote:
>> I've always felt they were useless and confusing. What's the
>> advantage of "y = (foo(), x + 3);" over "foo(); y = x+3;"?
>
> When you only see the x+3 because you're recursively walking the tree
> generating code.
>
>>> It's handy for things like rewriting ++e so it can be used more than
>>> once but is only evaluated once:
>>>
>>> (tmp = ++e, tmp)
>>
>> Uh? How is that different from "++e"
>
> You can then use tmp more than once with only one increment of e.
I guess I'll need a complete concrete example before I understand.
I mean:
tmp = ++e;
veryComplexExpressionThatUsesTmpSeveralTimesWithoutTouchingE;
Or even:
++e;
veryComplexExpressionThatUsesESeveralTimesWithoutIncrementingIt;
Are both clearer, less error-prone and should produce equivalent
code to the coma expression.
Jerome
--
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20090710/ac95b6d9/attachment.pgp>
More information about the Digitalmars-d
mailing list