Discussion:
UFCS in C++
(too old to reply)
Peter Alexander via Digitalmars-d
2014-10-13 08:53:26 UTC
Permalink
Looks like Bjarne has proposed UFCS for C++

http://isocpp.org/files/papers/N4174.pdf

No mention of D though...
Francesco Cattoglio via Digitalmars-d
2014-10-13 09:32:56 UTC
Permalink
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
Seriously, not even a mention? Ok, I'm mad. Can I be mad?
Szymon Gatner via Digitalmars-d
2014-10-13 09:47:13 UTC
Permalink
On Monday, 13 October 2014 at 09:32:58 UTC, Francesco Cattoglio
On Monday, 13 October 2014 at 08:53:28 UTC, Peter Alexander
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
Seriously, not even a mention? Ok, I'm mad. Can I be mad?
To be fair, it is not a new concept in C++...
Brad Anderson via Digitalmars-d
2014-10-13 16:48:20 UTC
Permalink
On Monday, 13 October 2014 at 09:32:58 UTC, Francesco Cattoglio
On Monday, 13 October 2014 at 08:53:28 UTC, Peter Alexander
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
Seriously, not even a mention? Ok, I'm mad. Can I be mad?
If you want but from what I recall the idea for UFCS came from an
article by Scott Meyers where he writes about how he wishes C++
had this feature[1].

http://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsu/184401197

(haven't read it or the archives in awhile so I may be
summarizing history incorrectly)
Paulo Pinto via Digitalmars-d
2014-10-13 11:04:05 UTC
Permalink
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
After going through most of the CppCon videos during the weekend,
I am starting to be afraid what C++17 or C++20 might look like.

Even Ada 2012 seems to be simpler to deal with.

--
Paulo
ketmar via Digitalmars-d
2014-10-13 11:15:56 UTC
Permalink
On Mon, 13 Oct 2014 11:04:05 +0000
Post by Paulo Pinto via Digitalmars-d
I am starting to be afraid what C++17 or C++20 might look like.
a monster praying "keeeel meeeee..." ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141013/a179c6b3/attachment.sig>
NimrodTheShlomo via Digitalmars-d
2014-10-13 15:37:13 UTC
Permalink
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
UFCS in Pascal

http://forum.lazarus.freepascal.org/index.php/topic,26025.45.html
ponce via Digitalmars-d
2014-10-13 16:14:36 UTC
Permalink
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
UFCS could be fun in C++ with dependence on import order and the
best-match rule.
ketmar via Digitalmars-d
2014-10-13 16:21:01 UTC
Permalink
On Mon, 13 Oct 2014 16:14:36 +0000
Post by ponce via Digitalmars-d
UFCS could be fun in C++ with dependence on import order and the
best-match rule.
c++ coders love to fight with their tools. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141013/4359d54e/attachment.sig>
Paulo Pinto via Digitalmars-d
2014-10-13 17:29:56 UTC
Permalink
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
Just noticed that Herb Sutter also presented one,

http://isocpp.org/files/papers/N4165.pdf

--
Paulo
via Digitalmars-d
2014-10-13 22:25:47 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
Just noticed that Herb Sutter also presented one,
http://isocpp.org/files/papers/N4165.pdf
Yes, this was a much better idea than UFCS. Having a syntax that
supports IDE and tooling could justify having two syntaxes for
the same thing even though it does pollute the namespace for
questionable gains.
Walter Bright via Digitalmars-d
2014-10-13 18:50:51 UTC
Permalink
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/

and:

https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/cl8fil5

Anyone remember just when it appeared in D? (It's not in D1.)
Steven Schveighoffer via Digitalmars-d
2014-10-14 01:55:24 UTC
Permalink
Post by Walter Bright via Digitalmars-d
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/cl8fil5
Anyone remember just when it appeared in D? (It's not in D1.)
The concept is in D1 for arrays since as long as I've ever used D.

I can't see the version exactly that added UFCS, but 2.058 (2011) says:

* Allow 1.userproperty syntax

Which I think is when it was really added.

-Steve
Walter Bright via Digitalmars-d
2014-10-14 02:25:27 UTC
Permalink
Post by Steven Schveighoffer via Digitalmars-d
Post by Walter Bright via Digitalmars-d
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/cl8fil5
Anyone remember just when it appeared in D? (It's not in D1.)
The concept is in D1 for arrays since as long as I've ever used D.
* Allow 1.userproperty syntax
Which I think is when it was really added.
-Steve
Thanks!
Jacob Carlborg via Digitalmars-d
2014-10-14 06:29:02 UTC
Permalink
Post by Steven Schveighoffer via Digitalmars-d
The concept is in D1 for arrays since as long as I've ever used D.
As far as I recall, it was an accidental feature of arrays and perhaps
associative arrays. Might be a bit hard to track down that.
--
/Jacob Carlborg
Don via Digitalmars-d
2014-10-14 10:38:49 UTC
Permalink
Post by Jacob Carlborg via Digitalmars-d
Post by Steven Schveighoffer via Digitalmars-d
The concept is in D1 for arrays since as long as I've ever
used D.
As far as I recall, it was an accidental feature of arrays and
perhaps associative arrays. Might be a bit hard to track down
that.
It wasn't accidental. It was one of the classic D easter eggs. It
was commented in the source, but wasn't documented anywhere or
mentioned when it was released.
It wasn't documented for at least a year after it was implemented.


BTW the greatest easter egg of them all was the template syntax,
class Bar(T) {..}
Previously you had to write template(T) { class Bar {} }, someone
discovered it and then Walter confessed to having done it. Those
were the days...
Walter Bright via Digitalmars-d
2014-10-14 22:15:54 UTC
Permalink
Post by Don via Digitalmars-d
and then Walter confessed to having done it.
I was threatened with the Comfy Chair. What else could I do?

Jesse Phillips via Digitalmars-d
2014-10-14 15:34:23 UTC
Permalink
Post by Walter Bright via Digitalmars-d
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/cl8fil5
Anyone remember just when it appeared in D? (It's not in D1.)
Full support was added in 2.059 Apr 12, 2012

http://dlang.org/changelog.html
Bugzilla 3382: [tdpl] Implement uniform function call syntax

But it has worked on arrays for much longer.
Steven Schveighoffer via Digitalmars-d
2014-10-14 17:09:03 UTC
Permalink
Post by Jesse Phillips via Digitalmars-d
Post by Walter Bright via Digitalmars-d
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/
https://www.reddit.com/r/programming/comments/2j3kr4/proposal_for_unified_call_syntax_for_c_xfy_vs_fxy/cl8fil5
Anyone remember just when it appeared in D? (It's not in D1.)
Full support was added in 2.059 Apr 12, 2012
http://dlang.org/changelog.html
Bugzilla 3382: [tdpl] Implement uniform function call syntax
Yep, I messed up.

The "Allow 1.property syntax" was just a precursor to UFCS that
disallowed 1.f syntax.

-Steve
Ali Çehreli via Digitalmars-d
2014-10-13 21:19:18 UTC
Permalink
Post by Peter Alexander via Digitalmars-d
Looks like Bjarne has proposed UFCS for C++
http://isocpp.org/files/papers/N4174.pdf
No mention of D though...
Actually, there are references to D in that article. One of those is
even about considering D as an "alternative". An excerpt from page 10:

void alternative(D& d) // an alternative to consider
{
// ...
}

Ali
"I am NOT kidding!" :)
Christof Schardt via Digitalmars-d
2014-10-13 21:32:56 UTC
Permalink
:-) Ali, you made my day!
Post by Ali Çehreli via Digitalmars-d
Actually, there are references to D in that article. One of those is
void alternative(D& d) // an alternative to consider
{
// ...
}
Continue reading on narkive:
Loading...