Topic: Add the operator ' as a unary operator
Author: me@ryanlewis.net
Date: Tue, 18 Aug 2015 22:09:08 -0700 (PDT)
Raw View
------=_Part_5871_1119906157.1439960948387
Content-Type: multipart/alternative;
boundary="----=_Part_5872_772083301.1439960948387"
------=_Part_5872_772083301.1439960948387
Content-Type: text/plain; charset=UTF-8
What do you all think of adding this new operator?
If we had the symbol ' usable as an operator we could express concepts such
as matrix and vector transpose nicely:
Matrix A;
y = A'*v e.g. y = (A')*v
class Matrix {
Matrix& operator'(){ inplace_transpose(..); return *this; }
}; //end class matrix
--
---
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/.
------=_Part_5872_772083301.1439960948387
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>What do you all think of adding this new operator?</d=
iv><div><br></div>If we had the symbol ' usable as an operator we could=
express concepts such as matrix and vector transpose nicely:<div><br></div=
><div><br></div><div>Matrix A;</div><div><br></div><div>y =3D A'*v e.g.=
y =3D (A')*v</div><div><br></div><div>class Matrix {</div><div><br></d=
iv><div>Matrix& operator'(){ inplace_transpose(..); return *this; }=
</div><div><br>}; //end class matrix</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" 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_5872_772083301.1439960948387--
------=_Part_5871_1119906157.1439960948387--
.
Author: Max Truxa <me@maxtruxa.com>
Date: Wed, 19 Aug 2015 00:10:40 -0700 (PDT)
Raw View
------=_Part_1343_769141513.1439968240699
Content-Type: text/plain; charset=UTF-8
Changing the core language to add syntactic sugar for such a specific case doesn't sound like a good idea IMO.
Plus, I don't think this is can be parsed reliably (but I'm definitely no expert regarding parsers):
a'*'x';
Looking at your example I think it would be pretty surprising to see a non-const `operator'`. Would you expect e.g. `operator!` to modify its operand?
auto backup = anything;
!anything;
assert(anything == backup); // Should never fail.
Your example could easily be rewritten using `inplace_transpose` to have less surprising semantics and work exactly like you want it to (just without the syntactic sugar) like so:
Matrix A;
y = A.transpose() * v;
class Matrix {
// ...
Matrix transpose() const {
Matrix m(*this);
m.inplace_transpose();
return m;
}
};
--
---
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/.
------=_Part_1343_769141513.1439968240699--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Wed, 19 Aug 2015 00:11:18 -0700
Raw View
On Tuesday 18 August 2015 22:09:08 me@ryanlewis.net wrote:
> What do you all think of adding this new operator?
>
> If we had the symbol ' usable as an operator we could express concepts such
> as matrix and vector transpose nicely:
>
>
> Matrix A;
>
> y = A'*v e.g. y = (A')*v
>
> class Matrix {
>
> Matrix& operator'(){ inplace_transpose(..); return *this; }
>
> }; //end class matrix
What's wrong with operator- or operator~ ?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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: me@ryanlewis.net
Date: Sun, 27 Sep 2015 17:29:53 -0700 (PDT)
Raw View
------=_Part_5154_440903241.1443400193746
Content-Type: multipart/alternative;
boundary="----=_Part_5155_1626775411.1443400193746"
------=_Part_5155_1626775411.1443400193746
Content-Type: text/plain; charset=UTF-8
Hi,
I suppose you are right about this particular operator. However, it is an
unfortunate language hole from the use case of describing linear algebra
within C++. I suppose the way to go about getting this support it to first
add support for basic linear algebra in a verbose way, and then let people
optimize the language to say things more succinctly.
On Wednesday, August 19, 2015 at 12:10:40 AM UTC-7, Max Truxa wrote:
>
> Changing the core language to add syntactic sugar for such a specific case
> doesn't sound like a good idea IMO.
> Plus, I don't think this is can be parsed reliably (but I'm definitely no
> expert regarding parsers):
>
> a'*'x';
>
>
> Looking at your example I think it would be pretty surprising to see a
> non-const `operator'`. Would you expect e.g. `operator!` to modify its
> operand?
> auto backup = anything;
> !anything;
> assert(anything == backup); // Should never fail.
>
> Your example could easily be rewritten using `inplace_transpose` to have
> less surprising semantics and work exactly like you want it to (just
> without the syntactic sugar) like so:
>
> Matrix A;
> y = A.transpose() * v;
>
> class Matrix {
> // ...
> Matrix transpose() const {
> Matrix m(*this);
> m.inplace_transpose();
> return m;
> }
> };
>
>
--
---
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/.
------=_Part_5155_1626775411.1443400193746
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi,<div><br></div><div>I suppose you are right about this =
particular operator. However, it =C2=A0is an unfortunate language hole from=
the use case of describing linear algebra within C++. I suppose the way to=
go about getting this support it to first add support for basic linear alg=
ebra in a verbose way, and then let people optimize the language to say thi=
ngs more succinctly.</div><div><br><br>On Wednesday, August 19, 2015 at 12:=
10:40 AM UTC-7, Max Truxa wrote:<blockquote class=3D"gmail_quote" style=3D"=
margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;=
">Changing the core language to add syntactic sugar for such a specific cas=
e doesn't sound like a good idea IMO.<br>Plus, I don't think this i=
s can be parsed reliably (but I'm definitely no expert regarding parser=
s):<p>a'*'x';</p><p><br>Looking at your example I think it woul=
d be pretty surprising to see a non-const `operator'`. Would you expect=
e.g. `operator!` to modify its operand?<br>=C2=A0 auto backup =3D anything=
;<br>=C2=A0 !anything;<br>=C2=A0 assert(anything =3D=3D backup); // Should =
never fail.</p><p>Your example could easily be rewritten using `inplace_tra=
nspose` to have less surprising semantics and work exactly like you want it=
to (just without the syntactic sugar) like so:</p><p>Matrix A;<br>y =3D A.=
transpose() * v;</p><p>class Matrix {<br>=C2=A0 // ...<br>=C2=A0 Matrix tra=
nspose() const {<br>=C2=A0 =C2=A0 Matrix m(*this);<br>=C2=A0 =C2=A0 m.inpla=
ce_transpose();<br>=C2=A0 =C2=A0 return m;<br>=C2=A0 }<br>};</p><p></p><p><=
/p><p></p><p></p></blockquote></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" 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_5155_1626775411.1443400193746--
------=_Part_5154_440903241.1443400193746--
.
Author: Andrew Tomazos <andrewtomazos@gmail.com>
Date: Mon, 28 Sep 2015 02:38:36 +0200
Raw View
--f46d04462e6af719250520c3ea74
Content-Type: text/plain; charset=UTF-8
Just use .transpose()
If we added an operator everytime someone wanted one, the language would
resemble modem line-noise.
On Mon, Sep 28, 2015 at 2:29 AM, <me@ryanlewis.net> wrote:
> Hi,
>
> I suppose you are right about this particular operator. However, it is an
> unfortunate language hole from the use case of describing linear algebra
> within C++. I suppose the way to go about getting this support it to first
> add support for basic linear algebra in a verbose way, and then let people
> optimize the language to say things more succinctly.
>
>
> On Wednesday, August 19, 2015 at 12:10:40 AM UTC-7, Max Truxa wrote:
>>
>> Changing the core language to add syntactic sugar for such a specific
>> case doesn't sound like a good idea IMO.
>> Plus, I don't think this is can be parsed reliably (but I'm definitely no
>> expert regarding parsers):
>>
>> a'*'x';
>>
>>
>> Looking at your example I think it would be pretty surprising to see a
>> non-const `operator'`. Would you expect e.g. `operator!` to modify its
>> operand?
>> auto backup = anything;
>> !anything;
>> assert(anything == backup); // Should never fail.
>>
>> Your example could easily be rewritten using `inplace_transpose` to have
>> less surprising semantics and work exactly like you want it to (just
>> without the syntactic sugar) like so:
>>
>> Matrix A;
>> y = A.transpose() * v;
>>
>> class Matrix {
>> // ...
>> Matrix transpose() const {
>> Matrix m(*this);
>> m.inplace_transpose();
>> return m;
>> }
>> };
>>
>> --
>
> ---
> 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/.
>
--
---
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/.
--f46d04462e6af719250520c3ea74
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Just use .transpose()<div><br></div><div>If we added an op=
erator everytime someone wanted one, the language would resemble modem line=
-noise.</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote=
">On Mon, Sep 28, 2015 at 2:29 AM, <span dir=3D"ltr"><<a href=3D"mailto=
:me@ryanlewis.net" target=3D"_blank">me@ryanlewis.net</a>></span> wrote:=
<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi,<div><br></div><div>=
I suppose you are right about this particular operator. However, it =C2=A0i=
s an unfortunate language hole from the use case of describing linear algeb=
ra within C++. I suppose the way to go about getting this support it to fir=
st add support for basic linear algebra in a verbose way, and then let peop=
le optimize the language to say things more succinctly.</div><div><div clas=
s=3D"h5"><div><br><br>On Wednesday, August 19, 2015 at 12:10:40 AM UTC-7, M=
ax Truxa wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-l=
eft:0.8ex;border-left:1px #ccc solid;padding-left:1ex">Changing the core la=
nguage to add syntactic sugar for such a specific case doesn't sound li=
ke a good idea IMO.<br>Plus, I don't think this is can be parsed reliab=
ly (but I'm definitely no expert regarding parsers):<p>a'*'x=
9;;</p><p><br>Looking at your example I think it would be pretty surprising=
to see a non-const `operator'`. Would you expect e.g. `operator!` to m=
odify its operand?<br>=C2=A0 auto backup =3D anything;<br>=C2=A0 !anything;=
<br>=C2=A0 assert(anything =3D=3D backup); // Should never fail.</p><p>Your=
example could easily be rewritten using `inplace_transpose` to have less s=
urprising semantics and work exactly like you want it to (just without the =
syntactic sugar) like so:</p><p>Matrix A;<br>y =3D A.transpose() * v;</p><p=
>class Matrix {<br>=C2=A0 // ...<br>=C2=A0 Matrix transpose() const {<br>=
=C2=A0 =C2=A0 Matrix m(*this);<br>=C2=A0 =C2=A0 m.inplace_transpose();<br>=
=C2=A0 =C2=A0 return m;<br>=C2=A0 }<br>};</p><p></p><p></p><p></p><p></p></=
blockquote></div></div></div></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" 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" 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 />
--f46d04462e6af719250520c3ea74--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Sun, 27 Sep 2015 19:42:38 -0700
Raw View
On Monday 28 September 2015 02:38:36 Andrew Tomazos wrote:
> If we added an operator everytime someone wanted one, the language would
> resemble modem line-noise.
Or sendmail.cf
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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: Michael Reilly <omnipotententity@gmail.com>
Date: Tue, 29 Sep 2015 09:14:21 -0700 (PDT)
Raw View
------=_Part_5753_753793871.1443543261517
Content-Type: multipart/alternative;
boundary="----=_Part_5754_944417632.1443543261517"
------=_Part_5754_944417632.1443543261517
Content-Type: text/plain; charset=UTF-8
It cannot be parsed. Adding an operator' results in undecidable parsing.
Consider the line:
auto a = L'*x';
This is currently parsed as a wchar_t literal containing '*'. The x is
discarded as extraneous and you may get a compiler warning about it.
This could also be parsed as L.operator'() * x.operator'();
On Wednesday, August 19, 2015 at 3:10:40 AM UTC-4, Max Truxa wrote:
>
> Changing the core language to add syntactic sugar for such a specific case
> doesn't sound like a good idea IMO.
> Plus, I don't think this is can be parsed reliably (but I'm definitely no
> expert regarding parsers):
>
> a'*'x';
>
>
> Looking at your example I think it would be pretty surprising to see a
> non-const `operator'`. Would you expect e.g. `operator!` to modify its
> operand?
> auto backup = anything;
> !anything;
> assert(anything == backup); // Should never fail.
>
> Your example could easily be rewritten using `inplace_transpose` to have
> less surprising semantics and work exactly like you want it to (just
> without the syntactic sugar) like so:
>
> Matrix A;
> y = A.transpose() * v;
>
> class Matrix {
> // ...
> Matrix transpose() const {
> Matrix m(*this);
> m.inplace_transpose();
> return m;
> }
> };
>
>
--
---
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/.
------=_Part_5754_944417632.1443543261517
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">It cannot be parsed. Adding an operator' results in un=
decidable parsing.<br><br>Consider the line:<br><br>auto a =3D L'*x'=
;;<br><br>This is currently parsed as a wchar_t literal containing '*&#=
39;.=C2=A0 The x is discarded as extraneous and you may get a compiler warn=
ing about it.<br><br>This could also be parsed as L.operator'() * x.ope=
rator'();<br><br>On Wednesday, August 19, 2015 at 3:10:40 AM UTC-4, Max=
Truxa wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Changing the core=
language to add syntactic sugar for such a specific case doesn't sound=
like a good idea IMO.<br>Plus, I don't think this is can be parsed rel=
iably (but I'm definitely no expert regarding parsers):<p>a'*'x=
';</p><p><br>Looking at your example I think it would be pretty surpris=
ing to see a non-const `operator'`. Would you expect e.g. `operator!` t=
o modify its operand?<br>=C2=A0 auto backup =3D anything;<br>=C2=A0 !anythi=
ng;<br>=C2=A0 assert(anything =3D=3D backup); // Should never fail.</p><p>Y=
our example could easily be rewritten using `inplace_transpose` to have les=
s surprising semantics and work exactly like you want it to (just without t=
he syntactic sugar) like so:</p><p>Matrix A;<br>y =3D A.transpose() * v;</p=
><p>class Matrix {<br>=C2=A0 // ...<br>=C2=A0 Matrix transpose() const {<br=
>=C2=A0 =C2=A0 Matrix m(*this);<br>=C2=A0 =C2=A0 m.inplace_transpose();<br>=
=C2=A0 =C2=A0 return m;<br>=C2=A0 }<br>};</p><p></p><p></p><p></p><p></p></=
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 <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_5754_944417632.1443543261517--
------=_Part_5753_753793871.1443543261517--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Tue, 29 Sep 2015 10:15:50 -0700
Raw View
On Tuesday 29 September 2015 09:14:21 Michael Reilly wrote:
> It cannot be parsed. Adding an operator' results in undecidable parsing.
>=20
> Consider the line:
>=20
> auto a =3D L'*x';
>=20
> This is currently parsed as a wchar_t literal containing '*'. The x is=
=20
> discarded as extraneous and you may get a compiler warning about it.
>=20
> This could also be parsed as L.operator'() * x.operator'();
And before anyone asks, ` is also taken:
auto x =3D 1`000`000`000;
Does anyone want to suggest the operator=E2=80=99 instead? Though if you lo=
ok at the=20
Unicode tables, it should actually be operator=E2=80=B2.
--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--=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: Klemens Morgenstern <klemens.morgenstern@gmx.net>
Date: Tue, 13 Oct 2015 01:44:47 -0700 (PDT)
Raw View
------=_Part_105_801799231.1444725887323
Content-Type: multipart/alternative;
boundary="----=_Part_106_643577545.1444725887323"
------=_Part_106_643577545.1444725887323
Content-Type: text/plain; charset=UTF-8
That is syntactically impossible, not just for obscurce examples, but for
long char values. That is writing
int i='word';
Is completly valid code, boost.static_string uses this excessively.
Don't you write a transposed matrix like this: A^T?
That's a completly possible thing, if you want syntactic sugar:
struct T_ {};
static constexpr T_ T;
matrix operator^(const matrix& m, const T_) {return m.transpose();}
void main()
{
matrix m;
m^T;
}
--
---
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/.
------=_Part_106_643577545.1444725887323
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">That is syntactically impossible, not just for obscurce ex=
amples, but for long char values. That is writing=C2=A0<div><div class=3D"p=
rettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break=
-word; background-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><=
div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> i</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=
</span><span style=3D"color: #080;" class=3D"styled-by-prettify">'word&=
#39;</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></di=
v></code></div>Is completly valid code, boost.static_string uses this exces=
sively.=C2=A0<br>Don't you write a transposed matrix like this: A^T?</d=
iv><div><br></div><div>That's a completly possible thing, if you want s=
yntactic sugar:</div><div><br></div><div><div class=3D"prettyprint" style=
=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; background=
-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"subp=
rettyprint"><div class=3D"subprettyprint"><font color=3D"#660066">struct T_=
{};</font></div><div class=3D"subprettyprint"><font color=3D"#660066">stat=
ic constexpr T_ T;</font></div><div class=3D"subprettyprint"><font color=3D=
"#660066"><br></font></div><div class=3D"subprettyprint"><font color=3D"#66=
0066">matrix operator^(const matrix& m, const T_) {return m.transpose()=
;}</font></div><div><div>void main()<br>{<br>=C2=A0 =C2=A0 matrix m;</div><=
div>=C2=A0 =C2=A0 m^T;<br>}</div></div></div></code></div><br></div><div><b=
r></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" 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_106_643577545.1444725887323--
------=_Part_105_801799231.1444725887323--
.
Author: David Krauss <potswa@gmail.com>
Date: Tue, 13 Oct 2015 17:06:22 +0800
Raw View
--Apple-Mail=_CF4A7221-1544-4EF1-A76B-FC0836A26FC9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
> On 2015=E2=80=9309=E2=80=9330, at 1:15 AM, Thiago Macieira <thiago@maciei=
ra.org> wrote:
>=20
> And before anyone asks, ` is also taken:
> auto x =3D 1`000`000`000;
The digit separator is '. The back-tick ` is still not part of the source c=
haracter set.
> Does anyone want to suggest the operator=E2=80=99 instead? Though if you =
look at the=20
> Unicode tables, it should actually be operator=E2=80=B2.
Unicode operators aren=E2=80=99t IMHO a ridiculous idea. They would cater t=
o domain-specific languages which may not care about portability or ease of=
input for ordinary folks.
For that reason, though, it=E2=80=99s more reasonable to implement a non-st=
andard compiler extension than to propose standardization. What the standar=
d can do is pare back the range of Unicode characters reserved for identifi=
ers. Currently it=E2=80=99s haphazard and excessive; I think it=E2=80=99s b=
ased on a Unicode recommendation for regular expressions and not the one fo=
r programming language identifiers. I had trouble navigating the standards =
when I tried to verify this, though.
Anyway, neither =E2=80=B2 nor =E2=80=99 are valid in identifiers, so I=E2=
=80=99m just griping.
--=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/.
--Apple-Mail=_CF4A7221-1544-4EF1-A76B-FC0836A26FC9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9309=
=E2=80=9330, at 1:15 AM, Thiago Macieira <<a href=3D"mailto:thiago@macie=
ira.org" class=3D"">thiago@macieira.org</a>> wrote:</div><br class=3D"Ap=
ple-interchange-newline"><div class=3D"">And before anyone asks, ` is also =
taken:<br class=3D""><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e"> </span>auto x =3D 1`000`000`000;<br class=3D""></div></blockquote><div>=
<br class=3D""></div><div>The digit separator is <font face=3D"Courier" cla=
ss=3D"">'</font>. The back-tick <font face=3D"Courier" class=3D"">`</font> =
is still not part of the source character set.</div><br class=3D""><blockqu=
ote type=3D"cite" class=3D""><div class=3D"">Does anyone want to suggest th=
e operator=E2=80=99 instead? Though if you look at the <br class=3D"">Unico=
de tables, it should actually be operator=E2=80=B2.<br class=3D""></div></b=
lockquote><br class=3D""></div><div>Unicode operators aren=E2=80=99t IMHO a=
ridiculous idea. They would cater to domain-specific languages which may n=
ot care about portability or ease of input for ordinary folks.</div><br cla=
ss=3D""><div class=3D"">For that reason, though, it=E2=80=99s more reasonab=
le to implement a non-standard compiler extension than to propose standardi=
zation. What the standard can do is pare back the range of Unicode characte=
rs reserved for identifiers. Currently it=E2=80=99s haphazard and excessive=
; I <i class=3D"">think</i> it=E2=80=99s based on a Unicode recommenda=
tion for regular expressions and not the one for programming language ident=
ifiers. I had trouble navigating the standards when I tried to verify this,=
though.</div><div class=3D""><br class=3D""></div><div class=3D"">Anyway, =
neither =E2=80=B2 nor =E2=80=99 are valid in identifiers, so I=E2=80=99m ju=
st griping.</div><div class=3D""><br class=3D""></div></body></html>
<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 <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 />
--Apple-Mail=_CF4A7221-1544-4EF1-A76B-FC0836A26FC9--
.
Author: Ryan Lewis <me@ryanlewis.net>
Date: Tue, 13 Oct 2015 14:14:10 +0000
Raw View
--001a113f8e7ed540c30521fd0fe2
Content-Type: text/plain; charset=UTF-8
' is commonly referred to as matlab notation. But, hey, what you just said
is a great alternative. That did not occur to me! Thanks!
On Tue, Oct 13, 2015, 1:44 AM Klemens Morgenstern <
klemens.morgenstern@gmx.net> wrote:
> That is syntactically impossible, not just for obscurce examples, but for
> long char values. That is writing
> int i='word';
> Is completly valid code, boost.static_string uses this excessively.
> Don't you write a transposed matrix like this: A^T?
>
> That's a completly possible thing, if you want syntactic sugar:
>
> struct T_ {};
> static constexpr T_ T;
>
> matrix operator^(const matrix& m, const T_) {return m.transpose();}
> void main()
> {
> matrix m;
> m^T;
> }
>
>
>
--
---
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/.
--001a113f8e7ed540c30521fd0fe2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<p dir=3D"ltr">' is commonly referred to as matlab notation. But, hey, =
what you just said is a great alternative. That did not occur to me! Thanks=
! <br>
</p>
<br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Oct 13, 2015, 1:44 =
AM=C2=A0Klemens Morgenstern <<a href=3D"mailto:klemens.morgenstern@gmx.n=
et">klemens.morgenstern@gmx.net</a>> wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr">That is syntactically impossible, not just f=
or obscurce examples, but for long char values. That is writing=C2=A0<div><=
div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;backgro=
und-color:rgb(250,250,250)"><code><div><span style=3D"color:#008">int</span=
><span style=3D"color:#000"> i</span><span style=3D"color:#660">=3D</span><=
span style=3D"color:#080">'word'</span><span style=3D"color:#660">;=
</span><span style=3D"color:#000"><br></span></div></code></div>Is completl=
y valid code, boost.static_string uses this excessively.=C2=A0<br>Don't=
you write a transposed matrix like this: A^T?</div><div><br></div><div>Tha=
t's a completly possible thing, if you want syntactic sugar:</div><div>=
<br></div><div><div style=3D"border:1px solid rgb(187,187,187);word-wrap:br=
eak-word;background-color:rgb(250,250,250)"><code><div><div><font color=3D"=
#660066">struct T_ {};</font></div><div><font color=3D"#660066">static cons=
texpr T_ T;</font></div><div><font color=3D"#660066"><br></font></div><div>=
<font color=3D"#660066">matrix operator^(const matrix& m, const T_) {re=
turn m.transpose();}</font></div><div><div>void main()<br>{<br>=C2=A0 =C2=
=A0 matrix m;</div><div>=C2=A0 =C2=A0 m^T;<br>}</div></div></div></code></d=
iv><br></div><div><br></div></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 <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 />
--001a113f8e7ed540c30521fd0fe2--
.