Case Range Statement ..

"Jérôme M. Berger" jeberger at free.fr
Thu Jul 9 15:19:09 PDT 2009


Walter Bright wrote:
> Nick Sabalausky wrote:
>> "Walter Bright" <newshound1 at digitalmars.com> wrote in message
>>> It's handy when you want to prefix one expression to another, as in:
>>>
>>>    (foo(), x + 3)
>>
>> I guess I'm not familiar with that syntax. What does that do and for 
>> what purpose? 
> 
> They're called Comma Expressions, and the left operand is evaluated 
> first, its result discarded, then the right operand is evaluated and 
> forms the type and result of the Comma Expression.
> 
	I've always felt they were useless and confusing. What's the 
advantage of "y = (foo(), x + 3);" over "foo(); y = x+3;"?

> 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"

		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/4ba342ef/attachment.pgp>


More information about the Digitalmars-d mailing list