Uniform function call syntax: Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile web edit
Tags: Mobile edit Mobile web edit
Line 53:
== C++ proposal ==
Proposals for a unification of member function and free function calling syntax have been discussed from the early years of [[C++]] standardization. Glassborow (2004) proposed a uniform calling syntax (UCS), allowing specially annotated free functions to be called with member function notation.<ref>{{cite web |title=N1585: Uniform Calling Syntax (Re-opening public interfaces) |author=Francis Glassborow |date=2 May 2004 |url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1585.pdf |accessdate=17 December 2018}}</ref>
In 2016 it was proposed a second time for addition to C++ by [[Bjarne Stroustrup]]<ref>{{cite web |title=UFCS proposal |url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4174.pdf |website=Open-std.org |accessdate=1 October 2017}}</ref> and [[Herb Sutter]],<ref name="auto"/> to reduce the ambiguous decision between writing [[Function (computer programming)#C and C++|free functions]] and member functions, to simplify the writing of [[generic programming|templated code]]. Many programmers are tempted to write member functions to get the benefits of the member function syntax (e.g. "[[Code completion|dot-autocomplete]]" to list [[member function]]s);<ref>{{cite web |title=Using IntelliSense |url=https://msdn.microsoft.com/en-us/library/hcw1s69b.aspx |website=MSDN |accessdate=1 October 2017}}</ref> however, this leads to excessive [[Coupling (computer programming)|coupling]] between [[Class (computer programming)|classes]].<ref>{{cite web |title=How Non-Member Functions Improve Encapsulation |url=https://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsu/184401197 |website=Drdobbs.com |accessdate=1 October 2017}}</ref> This haswas again, in 2023, been proposed by Herb Sutter<ref>{{Cite web |last=Sutter |first=Herb |date=13 October 2023 |title=Unified function call syntax (UFCS) |url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p3021r0.pdf }}</ref> claiming new information and insights, as well as an experimental implementation in the cppfront compiler.
 
== Rust usage of the term ==