www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - UFCS in C++

reply "Peter Alexander" <peter.alexander.au gmail.com> writes:
Looks like Bjarne has proposed UFCS for C++

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

No mention of D though...
Oct 13 2014
next sibling parent reply "Francesco Cattoglio" <francesco.cattoglio gmail.com> writes:
On Monday, 13 October 2014 at 08:53:28 UTC, Peter Alexander wrote:
 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?
Oct 13 2014
next sibling parent "Szymon Gatner" <noemail gmail.com> writes:
On Monday, 13 October 2014 at 09:32:58 UTC, Francesco Cattoglio 
wrote:
 On Monday, 13 October 2014 at 08:53:28 UTC, Peter Alexander 
 wrote:
 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++...
Oct 13 2014
prev sibling parent "Brad Anderson" <eco gnuk.net> writes:
On Monday, 13 October 2014 at 09:32:58 UTC, Francesco Cattoglio 
wrote:
 On Monday, 13 October 2014 at 08:53:28 UTC, Peter Alexander 
 wrote:
 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)
Oct 13 2014
prev sibling next sibling parent reply "Paulo Pinto" <pjmlp progtools.org> writes:
On Monday, 13 October 2014 at 08:53:28 UTC, Peter Alexander wrote:
 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
Oct 13 2014
parent ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Mon, 13 Oct 2014 11:04:05 +0000
Paulo  Pinto via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 I am starting to be afraid what C++17 or C++20 might look like.
a monster praying "keeeel meeeee..." ;-)
Oct 13 2014
prev sibling next sibling parent "NimrodTheShlomo" <Nim nowhere.il> writes:
On Monday, 13 October 2014 at 08:53:28 UTC, Peter Alexander wrote:
 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
Oct 13 2014
prev sibling next sibling parent reply "ponce" <contact gam3sfrommars.fr> writes:
On Monday, 13 October 2014 at 08:53:28 UTC, Peter Alexander wrote:
 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.
Oct 13 2014
parent ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Mon, 13 Oct 2014 16:14:36 +0000
ponce via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 UFCS could be fun in C++ with dependence on import order and the=20
 best-match rule.
c++ coders love to fight with their tools. ;-)
Oct 13 2014
prev sibling next sibling parent reply Paulo Pinto <pjmlp progtools.org> writes:
Am 13.10.2014 um 10:53 schrieb Peter Alexander:
 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
Oct 13 2014
parent "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= writes:
On Monday, 13 October 2014 at 17:29:56 UTC, Paulo Pinto wrote:
 Am 13.10.2014 um 10:53 schrieb Peter Alexander:
 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.
Oct 13 2014
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 10/13/2014 1:53 AM, Peter Alexander wrote:
 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.)
Oct 13 2014
next sibling parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 10/13/14 2:50 PM, Walter Bright wrote:
 On 10/13/2014 1:53 AM, Peter Alexander wrote:
 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.)
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
Oct 13 2014
next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 10/13/2014 6:55 PM, Steven Schveighoffer wrote:
 On 10/13/14 2:50 PM, Walter Bright wrote:
 On 10/13/2014 1:53 AM, Peter Alexander wrote:
 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.)
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
Thanks!
Oct 13 2014
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
On 14/10/14 03:55, Steven Schveighoffer wrote:

 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
Oct 13 2014
parent reply "Don" <x nospam.com> writes:
On Tuesday, 14 October 2014 at 06:29:01 UTC, Jacob Carlborg wrote:
 On 14/10/14 03:55, Steven Schveighoffer wrote:

 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...
Oct 14 2014
parent Walter Bright <newshound2 digitalmars.com> writes:
On 10/14/2014 3:38 AM, Don wrote:
 and then Walter confessed to having done it.
I was threatened with the Comfy Chair. What else could I do?
Oct 14 2014
prev sibling parent reply "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Monday, 13 October 2014 at 18:50:52 UTC, Walter Bright wrote:
 On 10/13/2014 1:53 AM, Peter Alexander wrote:
 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.)
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.
Oct 14 2014
parent Steven Schveighoffer <schveiguy yahoo.com> writes:
On 10/14/14 11:34 AM, Jesse Phillips wrote:
 On Monday, 13 October 2014 at 18:50:52 UTC, Walter Bright wrote:
 On 10/13/2014 1:53 AM, Peter Alexander wrote:
 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.)
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
Oct 14 2014
prev sibling parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 10/13/2014 01:53 AM, Peter Alexander wrote:
 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!" :)
Oct 13 2014
parent "Christof Schardt" <Christof Schardt.info> writes:
:-)    Ali, you made my day!

 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
 {
     // ...
 }
 
Oct 13 2014