lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] If with initializer (was: Why 'continue' here?)


From: Vadim Zeitlin
Subject: Re: [lmi] If with initializer (was: Why 'continue' here?)
Date: Thu, 9 Aug 2018 10:29:39 +0200

On Wed, 8 Aug 2018 16:19:49 +0000 Greg Chicares <address@hidden> wrote:

GC> I don't share your positive view of the "if statement with initializer"
GC> though.

 Why? IMO it's great and will allow to avoid a lot of contortions that were
previously necessary to avoid giving a too wide scope to the variables
needed only inside a single "if" branch. I do hope it is permitted in lmi
sources... I really can't see anything wrong with it.

GC> It looks like they've reinvented C's comma operator.

 No, not at all (besides, there is no need to reinvent something which was
part of C++ since always anyhow). They just made "if" (and "switch")
statements more consistent with "for", and the initialization part is just
useful in these statements as in the loop one.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]