Topic: operator()


Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Thu, 5 Feb 2015 03:42:00 -0800 (PST)
Raw View
------=_Part_138_360109984.1423136520092
Content-Type: multipart/alternative;
 boundary="----=_Part_139_759583842.1423136520092"

------=_Part_139_759583842.1423136520092
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I have been designing a library for a basis of a CAS.  I wanted to=20
implement an operator to operated like pow(x, y), with a higher precedence=
=20
than multiplication &c.  (Ab)using the unary operator*, with=20
multiplication, along with a liberal supply of TMP, I was able to implement=
=20
something looking like the Fortran operator **, with the correct precedence=
=20
and associativity.
=20
The only problem was with parentheses, as there is no way to stop the=20
escalation outside the parentheses.
=20
It is with this purpose that I would like to see a non-member operator(). =
=20
It is rather esoteric, I know, but I can=E2=80=99t see any other way to ach=
ieve my=20
goals.

--=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/.

------=_Part_139_759583842.1423136520092
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><DIV>I have been designing a library for a basis of a CAS.=
&nbsp; I wanted to implement an operator to operated like pow(x, y), with a=
 higher precedence than multiplication &amp;c.&nbsp; (Ab)using the unary op=
erator*, with multiplication, along with a liberal supply of TMP, I was abl=
e to implement something looking like the Fortran operator **, with the cor=
rect precedence and associativity.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The only problem was with parentheses, as there is no way to stop the =
escalation outside the parentheses.</DIV>
<DIV>&nbsp;</DIV>
<DIV>It is with this purpose that I would like to see a non-member operator=
().&nbsp; It is rather esoteric, I know, but I can=E2=80=99t see any other =
way to achieve my goals.</DIV></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+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/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_139_759583842.1423136520092--
------=_Part_138_360109984.1423136520092--

.


Author: Jens Maurer <Jens.Maurer@gmx.net>
Date: Wed, 11 Feb 2015 22:12:59 +0100
Raw View
On 02/05/2015 12:42 PM, Douglas Boffey wrote:
> I have been designing a library for a basis of a CAS.  I wanted to implem=
ent an operator to operated like pow(x, y), with a higher precedence than m=
ultiplication &c.  (Ab)using the unary operator*, with multiplication, alon=
g with a liberal supply of TMP, I was able to implement something looking l=
ike the Fortran operator **, with the correct precedence and associativity.
 =20
> The only problem was with parentheses, as there is no way to stop the esc=
alation outside the parentheses.
> =20
> It is with this purpose that I would like to see a non-member operator().=
  It is rather esoteric, I know, but I can=E2=80=99t see any other way to a=
chieve my goals.

I'm sorry, but I have trouble understanding your message.

 - What is CAS?  (atomic) compare-and-swap?

 - What is TMP?  Trimethyl phosphate?

 - Can you show an example what works and what doesn't?

 - Can you explain a little more why you need infix operator **
   instead of a regular function call?  After all, "sin" or
   "cos" don't have operators, either.

Thanks,
Jens

--=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/.

.


Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
Date: Wed, 11 Feb 2015 17:49:12 -0800 (PST)
Raw View
------=_Part_6_8742823.1423705752911
Content-Type: multipart/alternative;
 boundary="----=_Part_7_911738165.1423705752912"

------=_Part_7_911738165.1423705752912
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wednesday, February 11, 2015 at 1:13:03 PM UTC-8, Jens Maurer wrote:
>
> On 02/05/2015 12:42 PM, Douglas Boffey wrote:=20
> > I have been designing a library for a basis of a CAS.  I wanted to=20
> implement an operator to operated like pow(x, y), with a higher precedenc=
e=20
> than multiplication &c.  (Ab)using the unary operator*, with=20
> multiplication, along with a liberal supply of TMP, I was able to impleme=
nt=20
> something looking like the Fortran operator **, with the correct preceden=
ce=20
> and associativity.=20
>  =20
> > The only problem was with parentheses, as there is no way to stop the=
=20
> escalation outside the parentheses.=20
> >  =20
> > It is with this purpose that I would like to see a non-member=20
> operator().  It is rather esoteric, I know, but I can=E2=80=99t see any o=
ther way=20
> to achieve my goals.=20
>
> I'm sorry, but I have trouble understanding your message.=20
>
>  - What is CAS?  (atomic) compare-and-swap?=20
>

My guess would be "Computer Algebra System".
=20

>  - What is TMP?  Trimethyl phosphate?=20
>

In this context, that's certainly Template Meta-Programming.
=20

>  - Can you show an example what works and what doesn't?=20
>
>  - Can you explain a little more why you need infix operator **=20
>    instead of a regular function call?  After all, "sin" or=20
>    "cos" don't have operators, either.=20
>

Indeed; the proper response here is "don't do that then."  We've all abused=
=20
operator overloading to implement `a ** b` or `o----o`=20
<https://github.com/Quuxplusone/analog-literals> or `a &(swap)& b` for=20
recreational purposes, but such tricks don't belong in production code.=20
Just use the existing syntax `pow(x,y)`.

=E2=80=93Arthur

--=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/.

------=_Part_7_911738165.1423705752912
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, February 11, 2015 at 1:13:03 PM UTC-8, Jens =
Maurer wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 02/05/2015 12:=
42 PM, Douglas Boffey wrote:
<br>&gt; I have been designing a library for a basis of a CAS. &nbsp;I want=
ed to implement an operator to operated like pow(x, y), with a higher prece=
dence than multiplication &amp;c. &nbsp;(Ab)using the unary operator*, with=
 multiplication, along with a liberal supply of TMP, I was able to implemen=
t something looking like the Fortran operator **, with the correct preceden=
ce and associativity.
<br>&nbsp;=20
<br>&gt; The only problem was with parentheses, as there is no way to stop =
the escalation outside the parentheses.
<br>&gt; &nbsp;
<br>&gt; It is with this purpose that I would like to see a non-member oper=
ator(). &nbsp;It is rather esoteric, I know, but I can=E2=80=99t see any ot=
her way to achieve my goals.
<br>
<br>I'm sorry, but I have trouble understanding your message.
<br>
<br>&nbsp;- What is CAS? &nbsp;(atomic) compare-and-swap?
<br></blockquote><div><br></div><div>My guess would be "Computer Algebra Sy=
stem".</div><div>&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">&=
nbsp;- What is TMP? &nbsp;Trimethyl phosphate?
<br></blockquote><div><br></div><div>In this context, that's certainly Temp=
late Meta-Programming.</div><div>&nbsp;</div><blockquote class=3D"gmail_quo=
te" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddi=
ng-left: 1ex;">&nbsp;- Can you show an example what works and what doesn't?
<br>
<br>&nbsp;- Can you explain a little more why you need infix operator **
<br>&nbsp; &nbsp;instead of a regular function call? &nbsp;After all, "sin"=
 or
<br>&nbsp; &nbsp;"cos" don't have operators, either.
<br></blockquote><div><br></div><div>Indeed; the proper response here is "d=
on't do that then." &nbsp;We've all abused operator overloading to implemen=
t `a ** b` or <a href=3D"https://github.com/Quuxplusone/analog-literals">`o=
----o`</a> or `a &amp;(swap)&amp; b` for recreational purposes, but such tr=
icks don't belong in production code. Just use the existing syntax `pow(x,y=
)`.</div><div><br></div><div>=E2=80=93Arthur<br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+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/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_7_911738165.1423705752912--
------=_Part_6_8742823.1423705752911--

.


Author: Matheus Izvekov <mizvekov@gmail.com>
Date: Wed, 11 Feb 2015 19:09:02 -0800 (PST)
Raw View
------=_Part_5972_35144553.1423710542854
Content-Type: multipart/alternative;
 boundary="----=_Part_5973_116499346.1423710542854"

------=_Part_5973_116499346.1423710542854
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thursday, February 5, 2015 at 9:42:00 AM UTC-2, Douglas Boffey wrote:
>
> I have been designing a library for a basis of a CAS.  I wanted to=20
> implement an operator to operated like pow(x, y), with a higher precedenc=
e=20
> than multiplication &c.  (Ab)using the unary operator*, with=20
> multiplication, along with a liberal supply of TMP, I was able to impleme=
nt=20
> something looking like the Fortran operator **, with the correct preceden=
ce=20
> and associativity.
> =20
> The only problem was with parentheses, as there is no way to stop the=20
> escalation outside the parentheses.
> =20
> It is with this purpose that I would like to see a non-member operator().=
 =20
> It is rather esoteric, I know, but I can=E2=80=99t see any other way to a=
chieve my=20
> goals.
>

Why do you need the call operator to be non-member here? Assuming you are=
=20
implementing your own types (and if you aren't, maybe you should), then=20
what stops you from using a member call operator?

--=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/.

------=_Part_5973_116499346.1423710542854
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, February 5, 2015 at 9:42:00 AM UTC-2, Douglas=
 Boffey wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
><div>I have been designing a library for a basis of a CAS.&nbsp; I wanted =
to implement an operator to operated like pow(x, y), with a higher preceden=
ce than multiplication &amp;c.&nbsp; (Ab)using the unary operator*, with mu=
ltiplication, along with a liberal supply of TMP, I was able to implement s=
omething looking like the Fortran operator **, with the correct precedence =
and associativity.</div>
<div>&nbsp;</div>
<div>The only problem was with parentheses, as there is no way to stop the =
escalation outside the parentheses.</div>
<div>&nbsp;</div>
<div>It is with this purpose that I would like to see a non-member operator=
().&nbsp; It is rather esoteric, I know, but I can=E2=80=99t see any other =
way to achieve my goals.</div></div></blockquote><div><br>Why do you need t=
he call operator to be non-member here? Assuming you are implementing your =
own types (and if you aren't, maybe you should), then what stops you from u=
sing a member call operator?<br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+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/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_5973_116499346.1423710542854--
------=_Part_5972_35144553.1423710542854--

.


Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Thu, 12 Feb 2015 10:10:50 +0000
Raw View
CAS=3Dcomputer algebra system
TMP=3Dtemplate metaprogramming

On 2/11/15, Jens Maurer <Jens.Maurer@gmx.net> wrote:
> On 02/05/2015 12:42 PM, Douglas Boffey wrote:
>> I have been designing a library for a basis of a CAS.  I wanted to
>> implement an operator to operated like pow(x, y), with a higher preceden=
ce
>> than multiplication &c.  (Ab)using the unary operator*, with
>> multiplication, along with a liberal supply of TMP, I was able to
>> implement something looking like the Fortran operator **, with the corre=
ct
>> precedence and associativity.
>
>> The only problem was with parentheses, as there is no way to stop the
>> escalation outside the parentheses.
>>
>> It is with this purpose that I would like to see a non-member operator()=
..
>> It is rather esoteric, I know, but I can=E2=80=99t see any other way to =
achieve my
>> goals.
>
> I'm sorry, but I have trouble understanding your message.
>
>  - What is CAS?  (atomic) compare-and-swap?
>
>  - What is TMP?  Trimethyl phosphate?
>
>  - Can you show an example what works and what doesn't?
>
>  - Can you explain a little more why you need infix operator **
>    instead of a regular function call?  After all, "sin" or
>    "cos" don't have operators, either.
>
> Thanks,
> Jens
>
> --
>
> ---
> 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/.
>

--=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/.

.


Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Thu, 12 Feb 2015 10:14:46 +0000
Raw View
I am wanting to overload parentheses, not the function invocation operator.

On 2/12/15, Matheus Izvekov <mizvekov@gmail.com> wrote:
> On Thursday, February 5, 2015 at 9:42:00 AM UTC-2, Douglas Boffey wrote:
>>
>> I have been designing a library for a basis of a CAS.  I wanted to
>> implement an operator to operated like pow(x, y), with a higher preceden=
ce
>>
>> than multiplication &c.  (Ab)using the unary operator*, with
>> multiplication, along with a liberal supply of TMP, I was able to
>> implement
>> something looking like the Fortran operator **, with the correct
>> precedence
>> and associativity.
>>
>> The only problem was with parentheses, as there is no way to stop the
>> escalation outside the parentheses.
>>
>> It is with this purpose that I would like to see a non-member operator()=
..
>>
>> It is rather esoteric, I know, but I can=E2=80=99t see any other way to =
achieve my
>>
>> goals.
>>
>
> Why do you need the call operator to be non-member here? Assuming you are
> implementing your own types (and if you aren't, maybe you should), then
> what stops you from using a member call operator?
>
> --
>
> ---
> 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/.
>

--=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/.

.


Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Thu, 12 Feb 2015 11:24:05 +0000
Raw View
Ok, if we consider operators &, | and ^, which are of lower precedence
than the relational operators <, etc.  This is illogical.  By
overloading operator(), it is possible to correct the precedences (at
least for user-defined types).

--

---
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/.

.


Author: David Krauss <potswa@gmail.com>
Date: Thu, 12 Feb 2015 21:31:59 +0800
Raw View
> On 2015=E2=80=9302=E2=80=9312, at 7:24 PM, Douglas Boffey <douglas.boffey=
@gmail.com> wrote:
>=20
> Ok, if we consider operators &, | and ^, which are of lower precedence
> than the relational operators <, etc.  This is illogical.  By
> overloading operator(), it is possible to correct the precedences (at
> least for user-defined types).

Parentheses allow you to correct illogical precedences without any overload=
ing. ;)

Please, if this this thread needs anything, it=E2=80=99s examples.

--=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/.

.


Author: Jean-Marc Bourguet <jm.bourguet@gmail.com>
Date: Thu, 12 Feb 2015 05:53:40 -0800 (PST)
Raw View
------=_Part_56_1214407445.1423749220800
Content-Type: multipart/alternative;
 boundary="----=_Part_57_861347027.1423749220800"

------=_Part_57_861347027.1423749220800
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Le jeudi 12 f=C3=A9vrier 2015 12:24:06 UTC+1, Douglas Boffey a =C3=A9crit :
>
> Ok, if we consider operators &, | and ^, which are of lower precedence=20
> than the relational operators <, etc.  This is illogical.  By=20
> overloading operator(), it is possible to correct the precedences (at=20
> least for user-defined types).=20
>

Please correct me if I'm wrong.  You want to add parentheses overloading so=
=20
that, using template metaprogramming, you are able to interpret expressions=
=20
with other associativities and precedences than the one with which they are=
=20
parsed?

If so, I'll ask if you have any experience with languages allowing to=20
modify the associativity and precedence of operators?  Algol 68 was one=20
such language and although I was a little late in the game to get much=20
experience with it, I came early enough to know that the collective wisdom=
=20
was that changing associativity and precedence of existing operators is a=
=20
bad idea.

Do you have any reason to think that it would be different here?  Why? =20
I see at least two reasons to consider that in your use case, the result=20
will be even worse than for Algol 68:
- the meaning of operators is related to the built-in operators,
- there is an high risk that the fact that you are playing tricks and that=
=20
the way expressions are parsed is not the way they are interpreted will=20
show with surprising effect.

Yours,

--=20
Jean-Marc

--=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/.

------=_Part_57_861347027.1423749220800
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Le jeudi 12 f=C3=A9vrier 2015 12:24:06 UTC+1, Douglas Boff=
ey a =C3=A9crit&nbsp;:<blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Ok, if w=
e consider operators &amp;, | and ^, which are of lower precedence
<br>than the relational operators &lt;, etc. &nbsp;This is illogical. &nbsp=
;By
<br>overloading operator(), it is possible to correct the precedences (at
<br>least for user-defined types).
<br></blockquote><div><br></div><div>Please correct me if I'm wrong. &nbsp;=
You want to add parentheses overloading so that, using template metaprogram=
ming, you are able to interpret expressions with other associativities and =
precedences than the one with which they are parsed?</div><div><br></div><d=
iv>If so, I'll ask if you have any experience with languages allowing to mo=
dify the associativity and precedence of operators? &nbsp;Algol 68 was one =
such language and although I was a little late in the game to get much expe=
rience with it, I came early enough to know that the collective wisdom was =
that changing associativity and precedence of existing operators is a bad i=
dea.</div><div><br></div><div>Do you have any reason to think that it would=
 be different here? &nbsp;Why? &nbsp;</div><div>I see at least two reasons =
to consider that in your use case, the result will be even worse than for A=
lgol 68:</div><div>- the meaning of operators is related to the built-in op=
erators,</div><div>- there is an high risk that the fact that you are playi=
ng tricks and that the way expressions are parsed is not the way they are i=
nterpreted will show with surprising effect.</div><div><br></div><div>Yours=
,</div><div><br></div><div>--&nbsp;</div><div>Jean-Marc</div><div><br></div=
></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+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/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_57_861347027.1423749220800--
------=_Part_56_1214407445.1423749220800--

.


Author: Brent Friedman <fourthgeek@gmail.com>
Date: Sat, 14 Feb 2015 00:13:48 -0600
Raw View
--001a113ded2a962ea6050f064178
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Maybe you could build your proposal off of this one?

http://www.stroustrup.com/whitespace98.pdf

On Thu, Feb 12, 2015 at 7:53 AM, Jean-Marc Bourguet <jm.bourguet@gmail.com>
wrote:

> Le jeudi 12 f=C3=A9vrier 2015 12:24:06 UTC+1, Douglas Boffey a =C3=A9crit=
 :
>>
>> Ok, if we consider operators &, | and ^, which are of lower precedence
>> than the relational operators <, etc.  This is illogical.  By
>> overloading operator(), it is possible to correct the precedences (at
>> least for user-defined types).
>>
>
> Please correct me if I'm wrong.  You want to add parentheses overloading
> so that, using template metaprogramming, you are able to interpret
> expressions with other associativities and precedences than the one with
> which they are parsed?
>
> If so, I'll ask if you have any experience with languages allowing to
> modify the associativity and precedence of operators?  Algol 68 was one
> such language and although I was a little late in the game to get much
> experience with it, I came early enough to know that the collective wisdo=
m
> was that changing associativity and precedence of existing operators is a
> bad idea.
>
> Do you have any reason to think that it would be different here?  Why?
> I see at least two reasons to consider that in your use case, the result
> will be even worse than for Algol 68:
> - the meaning of operators is related to the built-in operators,
> - there is an high risk that the fact that you are playing tricks and tha=
t
> the way expressions are parsed is not the way they are interpreted will
> show with surprising effect.
>
> Yours,
>
> --
> Jean-Marc
>
>  --
>
> ---
> 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/.
>

--=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/.

--001a113ded2a962ea6050f064178
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Maybe you could build your proposal off of this one?<div><=
br></div><div><a href=3D"http://www.stroustrup.com/whitespace98.pdf">http:/=
/www.stroustrup.com/whitespace98.pdf</a><br></div></div><div class=3D"gmail=
_extra"><br><div class=3D"gmail_quote">On Thu, Feb 12, 2015 at 7:53 AM, Jea=
n-Marc Bourguet <span dir=3D"ltr">&lt;<a href=3D"mailto:jm.bourguet@gmail.c=
om" target=3D"_blank">jm.bourguet@gmail.com</a>&gt;</span> wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div dir=3D"ltr">Le jeudi 12 f=C3=A9vrier 2015 12:=
24:06 UTC+1, Douglas Boffey a =C3=A9crit=C2=A0:<span class=3D""><blockquote=
 class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px =
#ccc solid;padding-left:1ex">Ok, if we consider operators &amp;, | and ^, w=
hich are of lower precedence
<br>than the relational operators &lt;, etc.=C2=A0 This is illogical.=C2=A0=
 By
<br>overloading operator(), it is possible to correct the precedences (at
<br>least for user-defined types).
<br></blockquote><div><br></div></span><div>Please correct me if I&#39;m wr=
ong.=C2=A0 You want to add parentheses overloading so that, using template =
metaprogramming, you are able to interpret expressions with other associati=
vities and precedences than the one with which they are parsed?</div><div><=
br></div><div>If so, I&#39;ll ask if you have any experience with languages=
 allowing to modify the associativity and precedence of operators?=C2=A0 Al=
gol 68 was one such language and although I was a little late in the game t=
o get much experience with it, I came early enough to know that the collect=
ive wisdom was that changing associativity and precedence of existing opera=
tors is a bad idea.</div><div><br></div><div>Do you have any reason to thin=
k that it would be different here?=C2=A0 Why? =C2=A0</div><div>I see at lea=
st two reasons to consider that in your use case, the result will be even w=
orse than for Algol 68:</div><div>- the meaning of operators is related to =
the built-in operators,</div><div>- there is an high risk that the fact tha=
t you are playing tricks and that the way expressions are parsed is not the=
 way they are interpreted will show with surprising effect.</div><div><br><=
/div><div>Yours,</div><span class=3D"HOEnZb"><font color=3D"#888888"><div><=
br></div><div>--=C2=A0</div><div>Jean-Marc</div><div><br></div></font></spa=
n></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+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/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a113ded2a962ea6050f064178--

.