Topic: if statement proposals
Author: Chris F <christopher.fortmueller@gmail.com>
Date: Thu, 7 Mar 2013 00:18:24 -0800 (PST)
Raw View
------=_Part_644_18603602.1362644304134
Content-Type: text/plain; charset=ISO-8859-1
hi, just a idea, but wouldnt it be great if you could code an if statement
like
if (int a <100 && >10)
just a small improvement, but in my idea it wud imprve readability and also
enhance coding speed, without adding any other issues,
cheers,
a
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
------=_Part_644_18603602.1362644304134
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
hi, just a idea, but wouldnt it be great if you could code an if statement =
like <div><br></div><div>if (int a <100 && >10)</div><di=
v><br></div><div><br></div><div>just a small improvement, but in my idea it=
wud imprve readability and also enhance coding speed, without adding any o=
ther issues,</div><div><br></div><div><br></div><div>cheers,</div><div>a</d=
iv>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_644_18603602.1362644304134--
.
Author: Chris F <christopher.fortmueller@gmail.com>
Date: Thu, 7 Mar 2013 00:28:31 -0800 (PST)
Raw View
------=_Part_1223_9385055.1362644911235
Content-Type: text/plain; charset=ISO-8859-1
since cant seem to edit, what i meant:
int a = some value
if ( a <100 && >10) // here is the proposal, i.e the >10 without a, i.e the
compiler should assume in this case that the variable in the previous
condition is meant. this wouldnt add any problems but make life alot easier
in my opinion :)
On Thursday, 7 March 2013 09:18:24 UTC+1, Chris F wrote:
>
> hi, just a idea, but wouldnt it be great if you could code an if statement
> like
>
> if (int a <100 && >10)
>
>
> just a small improvement, but in my idea it wud imprve readability and
> also enhance coding speed, without adding any other issues,
>
>
> cheers,
> a
>
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
------=_Part_1223_9385055.1362644911235
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
since cant seem to edit, what i meant:<div><br></div><div>int a =3D s=
ome value</div><div>if ( a <100 && >10) // here is the propos=
al, i.e the >10 without a, i.e the compiler should assume in this case t=
hat the variable in the previous condition is meant. this wouldnt add any p=
roblems but make life alot easier in my opinion :)<br><br>On Thursday, 7 Ma=
rch 2013 09:18:24 UTC+1, Chris F wrote:<blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;">hi, just a idea, but wouldnt it be great if you could code an if =
statement like <div><br></div><div>if (int a <100 && >10=
)</div><div><br></div><div><br></div><div>just a small improvement, but in =
my idea it wud imprve readability and also enhance coding speed, without ad=
ding any other issues,</div><div><br></div><div><br></div><div>cheers,</div=
><div>a</div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_1223_9385055.1362644911235--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 7 Mar 2013 10:38:36 +0200
Raw View
On 7 March 2013 10:28, Chris F <christopher.fortmueller@gmail.com> wrote:
> since cant seem to edit, what i meant:
> int a = some value
> if ( a <100 && >10) // here is the proposal, i.e the >10 without a, i.e the
> compiler should assume in this case that the variable in the previous
> condition is meant. this wouldnt add any problems but make life alot easier
> in my opinion :)
Why shouldn't we just strive for
if (10 < a < 100)
instead?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Thu, 7 Mar 2013 10:08:35 +0100
Raw View
2013/3/7 Ville Voutilainen <ville.voutilainen@gmail.com>:
> On 7 March 2013 10:28, Chris F <christopher.fortmueller@gmail.com> wrote:
>> since cant seem to edit, what i meant:
>> int a = some value
>> if ( a <100 && >10) // here is the proposal, i.e the >10 without a, i.e the
>> compiler should assume in this case that the variable in the previous
>> condition is meant. this wouldnt add any problems but make life alot easier
>> in my opinion :)
>
> Why shouldn't we just strive for
>
> if (10 < a < 100)
>
> instead?
Unfortunately this is already valid but doesn't do what you expect ;-)
- Daniel
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 7 Mar 2013 11:20:45 +0200
Raw View
On 7 March 2013 11:08, Daniel Kr=FCgler <daniel.kruegler@gmail.com> wrote:
>> Why shouldn't we just strive for
>> if (10 < a < 100)
>> instead?
> Unfortunately this is already valid but doesn't do what you expect ;-)
That's why we might consider breaking its current meaning. I can't
imagine a valid
use for its current semantics, but there are all kinds of nutjobs in
the world who
will use every bit of the language to their twisted purposes. :)
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/?hl=3Den.
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Thu, 7 Mar 2013 01:51:20 -0800 (PST)
Raw View
------=_Part_955_14965158.1362649880259
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Thursday, March 7, 2013 1:20:45 AM UTC-8, Ville Voutilainen wrote:
>
> On 7 March 2013 11:08, Daniel Kr=FCgler <daniel....@gmail.com <javascript=
:>>=20
> wrote:=20
> >> Why shouldn't we just strive for=20
> >> if (10 < a < 100)=20
> >> instead?=20
> > Unfortunately this is already valid but doesn't do what you expect ;-)=
=20
>
> That's why we might consider breaking its current meaning. I can't=20
> imagine a valid=20
> use for its current semantics, but there are all kinds of nutjobs in=20
> the world who=20
> will use every bit of the language to their twisted purposes. :)=20
>
Somehow, I don't think we are going to opt to break Boost.Spirit like that.=
=20
Or any other C++ DSEL library that just so happened to overload the=20
comparison operators for its special types.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/?hl=3Den.
------=_Part_955_14965158.1362649880259
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><br>On Thursday, March 7, 2013 1:20:45 AM UTC-8, Ville Voutilainen wrot=
e:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;">On 7 March 2013 11:08, Danie=
l Kr=FCgler <<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-ma=
ilto=3D"ELImTfdGAcQJ">daniel....@gmail.com</a>> wrote:
<br>>> Why shouldn't we just strive for
<br>>> if (10 < a < 100)
<br>>> instead?
<br>> Unfortunately this is already valid but doesn't do what you expect=
;-)
<br>
<br>That's why we might consider breaking its current meaning. I can't
<br>imagine a valid
<br>use for its current semantics, but there are all kinds of nutjobs in
<br>the world who
<br>will use every bit of the language to their twisted purposes. :)
<br></blockquote><div><br>Somehow, I don't think we are going to opt to bre=
ak Boost.Spirit like that. Or any other C++ DSEL library that just so happe=
ned to overload the comparison operators for its special types.<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_955_14965158.1362649880259--
.
Author: "J. Daniel Garcia" <josedaniel.garcia@uc3m.es>
Date: Thu, 7 Mar 2013 05:12:02 -0600
Raw View
--f46d0401f53d0d1bec04d753c969
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I think that
if (10<a && a<100)
is not that bad.
However, if the issue is improving readability, what about the following:
if (a : {10, 100}) // if 10< a < 100
On Thu, Mar 7, 2013 at 3:20 AM, Ville Voutilainen <
ville.voutilainen@gmail.com> wrote:
> On 7 March 2013 11:08, Daniel Kr=FCgler <daniel.kruegler@gmail.com> wrote=
:
> >> Why shouldn't we just strive for
> >> if (10 < a < 100)
> >> instead?
> > Unfortunately this is already valid but doesn't do what you expect ;-)
>
> That's why we might consider breaking its current meaning. I can't
> imagine a valid
> use for its current semantics, but there are all kinds of nutjobs in
> the world who
> will use every bit of the language to their twisted purposes. :)
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=3Den.
>
>
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/?hl=3Den.
--f46d0401f53d0d1bec04d753c969
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I think that=A0<div><br></div><div style>if (10<a &=
& a<100)</div><div style><br></div><div style>is not that bad.</div>=
<div style><br></div><div style>However, if the issue is improving readabil=
ity, what about the following:</div>
<div style><br></div><div style>if (a : {10, 100}) // if 10< a < 100<=
/div><div style><br></div><div style><br></div><div style><br></div><div cl=
ass=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Thu, Mar 7, 2013 =
at 3:20 AM, Ville Voutilainen <span dir=3D"ltr"><<a href=3D"mailto:ville=
..voutilainen@gmail.com" target=3D"_blank">ville.voutilainen@gmail.com</a>&g=
t;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">On 7 March 2013 11:08, Dan=
iel Kr=FCgler <<a href=3D"mailto:daniel.kruegler@gmail.com">daniel.krueg=
ler@gmail.com</a>> wrote:<br>
>> Why shouldn't we just strive for<br>
>> if (10 < a < 100)<br>
>> instead?<br>
> Unfortunately this is already valid but doesn't do what you expect=
;-)<br>
<br>
</div>That's why we might consider breaking its current meaning. I can&=
#39;t<br>
imagine a valid<br>
use for its current semantics, but there are all kinds of nutjobs in<br>
the world who<br>
will use every bit of the language to their twisted purposes. :)<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-propo=
sals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
<br>
<br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div><br></d=
iv></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--f46d0401f53d0d1bec04d753c969--
.
Author: Marshall Clow <mclow.lists@gmail.com>
Date: Thu, 7 Mar 2013 07:44:18 -0800
Raw View
On Mar 7, 2013, at 3:12 AM, J. Daniel Garcia <josedaniel.garcia@uc3m.es> wrote:
> I think that
>
> if (10<a && a<100)
>
> is not that bad.
>
> However, if the issue is improving readability, what about the following:
>
> if (a : {10, 100}) // if 10< a < 100
If we're going to open this can of worms (which I am weakly against), I think we should consider:
if ( a in { 0 .. 100 })
if ( a in { 0, 1, 1, 2, 3, 5, 8, 13 } )
if ( 10 < a < 100 )
(and probably others)
-- Marshall
Marshall Clow Idio Software <mailto:mclow.lists@gmail.com>
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
-- Yu Suzuki
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: Zhihao Yuan <lichray@gmail.com>
Date: Thu, 7 Mar 2013 11:45:00 -0500
Raw View
On Thu, Mar 7, 2013 at 10:44 AM, Marshall Clow <mclow.lists@gmail.com> wrote:
> if ( a in { 0 .. 100 })
> if ( a in { 0, 1, 1, 2, 3, 5, 8, 13 } )
> if ( 10 < a < 100 )
> (and probably others)
if (a not in ...)
if (a is not ...) // LOL
--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: Fernando Cacciola <fernando.cacciola@gmail.com>
Date: Thu, 7 Mar 2013 14:03:27 -0300
Raw View
Sorry for hijacking the thread, but, what I would like to see in the
language is this:
tribool e = some_uncertain_expression ;
if ( e )
{
// e is true
}
else
{
// e is false
}
maybe
{
// can't tell whether it is true or false
}
The important point here is that, given just:
if ( e )
{
// e is true
}
else
{
// e is false
}
If e is "maybe" *it doesn't enter any of the two branches*.
Currently there is absolutely no way to do that *directly*, so instead
you have to write it like:
if ( is_certain(e) )
{
if ( e ) ...
else ...
}
else
{
}
Which, taken isolated like that is not bad, but when you have a lot of
conditional expressions, it ends up being a bit of a mess.
Best
--
Fernando Cacciola
SciSoft Consulting, Founder
http://www.scisoft-consulting.com
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Thu, 7 Mar 2013 14:16:18 -0500
Raw View
On Thu, Mar 7, 2013 at 12:03 PM, Fernando Cacciola
<fernando.cacciola@gmail.com> wrote:
>
> if ( e )
> {
> // e is true
> }
> else
> {
> // e is false
> }
> maybe
> {
> // can't tell whether it is true or false
> }
>
Why stop there? What about 'probably' and 'unlikely'?
Tony
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: Fernando Cacciola <fernando.cacciola@gmail.com>
Date: Thu, 7 Mar 2013 17:04:36 -0300
Raw View
On Thu, Mar 7, 2013 at 4:16 PM, Tony V E <tvaneerd@gmail.com> wrote:
> On Thu, Mar 7, 2013 at 12:03 PM, Fernando Cacciola
> <fernando.cacciola@gmail.com> wrote:
>>
>> if ( e )
>> {
>> // e is true
>> }
>> else
>> {
>> // e is false
>> }
>> maybe
>> {
>> // can't tell whether it is true or false
>> }
>>
>
> Why stop there? What about 'probably' and 'unlikely'?
>
I considered the case of four-valued and even general multi-valued
logic before posting, but lacking any real like use case for it, I
only focused on tribool, which should be familiar enough (there even
is Boost.Tribool).
OTOH, you are correct and it might be a miss-opportunity to stop there.
FWIW, in my code I often use trivalued logic and in reality, I only
need that the if/else branches only match the true/false clauses.
So, given, a multibool fundamental type, all I need from the language
is that rule for matching if/else. The rest would be handled by
ordinary case.
Best
--
Fernando Cacciola
SciSoft Consulting, Founder
http://www.scisoft-consulting.com
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: rob.desbois@gmail.com
Date: Mon, 11 Mar 2013 02:51:49 -0700 (PDT)
Raw View
------=_Part_109_5084192.1362995509940
Content-Type: text/plain; charset=ISO-8859-1
On Thursday, 7 March 2013 11:12:02 UTC, josedaniel.garcia wrote:
> I think that
>
> if (10<a && a<100)
>
> is not that bad.
>
> However, if the issue is improving readability, what about the following:
>
> if (a : {10, 100}) // if 10< a < 100
>
Or how about the following, which could easily be written without language
modification:
if ( in_interval(a, 10, 100) )
On Thursday, 7 March 2013 08:18:24 UTC, Chris F wrote:
> hi, just a idea, but wouldnt it be great if you could code an if statement
> like
>
> if (int a <100 && >10)
>
>
> just a small improvement, but in my idea it wud imprve readability and
> also enhance coding speed, without adding any other issues,
>
How would the syntax be defined here?
How would the compiler know to use 'a' as the missing operand in the second
bool expression vs. 100? We could presume that it's because 100 is literal,
but if the first were "a < b" then which one becomes the operand?
We could specify this partial bool expression construct is usable only when
the (or a) preceding bool expression has only one non-const object, but
that seems overly complex.
In addition, let's say we have the following code:
if (int a < 100 && b > 10)
If someone accidentally deletes the 'b' in this context then the behaviour
of the code is altered..whilst accidental code-changing in any case could
lead to a still-valid program with different behaviour, this adds to what
seems too many issues for little real benefit. Just my take on it though,
and I can't say I haven't previously thought such a context would be nice :)
--rob
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
------=_Part_109_5084192.1362995509940
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Thursday, 7 March 2013 11:12:02 UTC, josedaniel.garcia wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">I think that <=
div><br></div><div>if (10<a && a<100)</div><div><br></div><di=
v>is not that bad.</div><div><br></div><div>However, if the issue is improv=
ing readability, what about the following:</div>
<div><br></div><div>if (a : {10, 100}) // if 10< a < 100</div></div><=
/blockquote><div><br></div><div>Or how about the following, which could eas=
ily be written without language modification:</div><div> if ( i=
n_interval(a, 10, 100) )</div><div><br></div><div><br></div><div>On Thursda=
y, 7 March 2013 08:18:24 UTC, Chris F wrote:</div><blockquote class=3D"gmai=
l_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;=
padding-left: 1ex;"><div dir=3D"ltr"><div>hi, just a idea, but wouldnt it b=
e great if you could code an if statement like <div><br></div><div>if =
(int a <100 && >10)</div><div><br></div><div><br></div><div>j=
ust a small improvement, but in my idea it wud imprve readability and also =
enhance coding speed, without adding any other issues,</div></div></div></b=
lockquote><div><br></div><div>How would the syntax be defined here?</div><d=
iv>How would the compiler know to use 'a' as the missing operand in the sec=
ond bool expression vs. 100? We could presume that it's because 100 is lite=
ral, but if the first were "a < b" then which one becomes the operand?</=
div><div>We could specify this partial bool expression construct is usable =
only when the (or a) preceding bool expression has only one non-const objec=
t, but that seems overly complex.</div><div>In addition, let's say we have =
the following code:</div><div> if (int a < 100 && b =
> 10)</div><div><br></div><div>If someone accidentally deletes the 'b' i=
n this context then the behaviour of the code is altered..whilst accidental=
code-changing in any case could lead to a still-valid program with differe=
nt behaviour, this adds to what seems too many issues for little real benef=
it. Just my take on it though, and I can't say I haven't previously thought=
such a context would be nice :)</div><div><br></div><div>--rob</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_109_5084192.1362995509940--
.