digitalmars.D.announce - A new blog article detailing the alternative function syntax
- Gary Willoughby (10/10) Aug 08 2013 I've just finished a new blog article on the subject of
- Walter Bright (14/18) Aug 08 2013 s/compliments/complements/
- Walter Bright (2/3) Aug 08 2013 The frequency with which I see this error is a pet peeve of mine!
- Brad Anderson (2/6) Aug 08 2013 I know! It's rediculous!
- Gary Willoughby (5/6) Aug 08 2013 I've made the corrections, thanks. I really need to work on my
- Andrei Alexandrescu (7/13) Aug 08 2013 s/practise/practice/g :o)
- Gary Willoughby (3/7) Aug 09 2013 Sure go ahead.
- monarch_dodra (5/12) Aug 09 2013 Good read. I think I already knew all of it, but seeing it all
- Andrei Alexandrescu (4/10) Aug 09 2013 Much obliged:
- Brad Anderson (4/10) Aug 08 2013 http://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsu/1844...
- Walter Bright (4/14) Aug 08 2013 You're right. I was just too lazy to link to it myself. Thanks for doing...
- Rory McGuire (1/1) Aug 09 2013 Quick question: does UFCS allow you to make a type implement an interfac...
- Jonathan M Davis (9/10) Aug 09 2013 No. _All_ that UFCS does is take
- Ary Borenszweig (6/16) Aug 08 2013 Nice article.
- Tofu Ninja (2/28) Aug 08 2013 Maybe "unique" instead of "alternative"?
- Dejan Lekic (5/31) Aug 09 2013 I agree, the article title should be something like "Uniform
- anonymous (7/17) Aug 08 2013 I think you should mention the terms UFCS and IFTI, since those
- Gary Willoughby (2/8) Aug 08 2013 Good point.
- Jesse Phillips (5/15) Aug 08 2013 The second non-member function example is part of the -property
- Miles Stoudenmire (8/27) Aug 08 2013 s/quiet easily/quite easily/g
I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D. I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/alternative-function-syntax-in-d/ I'll post to reddit in the morning.
Aug 08 2013
On 8/8/2013 11:53 AM, Gary Willoughby wrote:I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/alternative-function-syntax-in-d/s/compliments/complements/ s/-profile/-property/ s/behaviour/behavior/ if you mean to use the american english spelling s/explained the rules/explained that the rules/ s/ommited/omitted/ s/in the call parens/in the call then parens/ s/i've/I've/ Under Extension Methods, a huge reason for them is to head off the temptation to write 'kitchen sink' classes that are filled with every conceivable method. The desired approach is to have the class implement the bare minimum of functionality, and add other functionality with extension methods (that do not have access to the class' private state). All in all, good article!
Aug 08 2013
On 8/8/2013 12:15 PM, Walter Bright wrote:s/compliments/complements/The frequency with which I see this error is a pet peeve of mine!
Aug 08 2013
On Thursday, 8 August 2013 at 19:18:22 UTC, Walter Bright wrote:On 8/8/2013 12:15 PM, Walter Bright wrote:I know! It's rediculous!s/compliments/complements/The frequency with which I see this error is a pet peeve of mine!
Aug 08 2013
On Thursday, 8 August 2013 at 19:15:29 UTC, Walter Bright wrote:lots...I've made the corrections, thanks. I really need to work on my English. I haven't written anything in years and it's harder work than i remember. Nothing that practise, practise, practise ...and a spell checker won't fix! ;)
Aug 08 2013
On 8/8/13 1:28 PM, Gary Willoughby wrote:On Thursday, 8 August 2013 at 19:15:29 UTC, Walter Bright wrote:s/practise/practice/g :o) If you want me to post to reddit tomorrow morning, let me know. My good post karma is likely to push the post into visibility quickly. On the other hand, if you post it yourself it will improve _your_ karma. Tradeoffs, tradeoffs... Andreilots...I've made the corrections, thanks. I really need to work on my English. I haven't written anything in years and it's harder work than i remember. Nothing that practise, practise, practise ...and a spell checker won't fix! ;)
Aug 08 2013
On Thursday, 8 August 2013 at 22:37:04 UTC, Andrei Alexandrescu wrote:If you want me to post to reddit tomorrow morning, let me know. My good post karma is likely to push the post into visibility quickly. On the other hand, if you post it yourself it will improve _your_ karma. Tradeoffs, tradeoffs...Sure go ahead.
Aug 09 2013
On Friday, 9 August 2013 at 08:03:45 UTC, Gary Willoughby wrote:On Thursday, 8 August 2013 at 22:37:04 UTC, Andrei Alexandrescu wrote:Good read. I think I already knew all of it, but seeing it all written in a concise and organized way is always a good refresher, and also reminds you of the why things are the way they are.If you want me to post to reddit tomorrow morning, let me know. My good post karma is likely to push the post into visibility quickly. On the other hand, if you post it yourself it will improve _your_ karma. Tradeoffs, tradeoffs...Sure go ahead.
Aug 09 2013
On 8/9/13 1:03 AM, Gary Willoughby wrote:On Thursday, 8 August 2013 at 22:37:04 UTC, Andrei Alexandrescu wrote:Much obliged: http://www.reddit.com/r/programming/comments/1k18ls/alternative_function_syntax_in_d_explained/ AndreiIf you want me to post to reddit tomorrow morning, let me know. My good post karma is likely to push the post into visibility quickly. On the other hand, if you post it yourself it will improve _your_ karma. Tradeoffs, tradeoffs...Sure go ahead.
Aug 09 2013
On Thursday, 8 August 2013 at 19:15:29 UTC, Walter Bright wrote:Under Extension Methods, a huge reason for them is to head off the temptation to write 'kitchen sink' classes that are filled with every conceivable method. The desired approach is to have the class implement the bare minimum of functionality, and add other functionality with extension methods (that do not have access to the class' private state).I think you linked this Meyers article at some point as being the original rationale for UFCS (correct me if I'm wrong).
Aug 08 2013
On 8/8/2013 3:02 PM, Brad Anderson wrote:On Thursday, 8 August 2013 at 19:15:29 UTC, Walter Bright wrote:You're right. I was just too lazy to link to it myself. Thanks for doing it. BTW, I think that article is required reading. It's an easy read, and was an eye-opener for me.Under Extension Methods, a huge reason for them is to head off the temptation to write 'kitchen sink' classes that are filled with every conceivable method. The desired approach is to have the class implement the bare minimum of functionality, and add other functionality with extension methods (that do not have access to the class' private state).I think you linked this Meyers article at some point as being the original rationale for UFCS (correct me if I'm wrong).
Aug 08 2013
Quick question: does UFCS allow you to make a type implement an interface?
Aug 09 2013
On Friday, August 09, 2013 12:25:25 Rory McGuire wrote:Quick question: does UFCS allow you to make a type implement an interface?No. _All_ that UFCS does is take auto result = foo.bar(args); and lower it to auto result = bar(foo, args); It's purely syntactic sugar, much as that sugar has some great benefits for generic code. For a class to implement an interface method, that method must actually be part of the class or one of its base classes. - Jonathan M Davis
Aug 09 2013
On 8/8/13 3:53 PM, Gary Willoughby wrote:I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D. I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/alternative-function-syntax-in-d/ I'll post to reddit in the morning.Nice article. But when I read "alternative function syntax" I thought your article was a proposal for that, an alternative function syntax. :-P Maybe it should be renamed to something else... but I don't know enough English to suggest that.
Aug 08 2013
On Thursday, 8 August 2013 at 19:24:31 UTC, Ary Borenszweig wrote:On 8/8/13 3:53 PM, Gary Willoughby wrote:Maybe "unique" instead of "alternative"?I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D. I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/alternative-function-syntax-in-d/ I'll post to reddit in the morning.Nice article. But when I read "alternative function syntax" I thought your article was a proposal for that, an alternative function syntax. :-P Maybe it should be renamed to something else... but I don't know enough English to suggest that.
Aug 08 2013
On Thursday, 8 August 2013 at 19:24:31 UTC, Ary Borenszweig wrote:On 8/8/13 3:53 PM, Gary Willoughby wrote:I agree, the article title should be something like "Uniform Function Call Syntax". Exactly like in in this article: http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394 .I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D. I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/alternative-function-syntax-in-d/ I'll post to reddit in the morning.Nice article. But when I read "alternative function syntax" I thought your article was a proposal for that, an alternative function syntax. :-P Maybe it should be renamed to something else... but I don't know enough English to suggest that.
Aug 09 2013
On Thursday, 8 August 2013 at 18:53:47 UTC, Gary Willoughby wrote:I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D. I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/alternative-function-syntax-in-d/ I'll post to reddit in the morning.I think you should mention the terms UFCS and IFTI, since those are used by D folk. UFCS: Universal Function Call Syntax, i.e. dot notation. IFTI: Implicit Function Template Instantiation, i.e. template parameters can be omitted when they can be deduced from the function arguments.
Aug 08 2013
On Thursday, 8 August 2013 at 20:37:35 UTC, anonymous wrote:I think you should mention the terms UFCS and IFTI, since those are used by D folk. UFCS: Universal Function Call Syntax, i.e. dot notation. IFTI: Implicit Function Template Instantiation, i.e. template parameters can be omitted when they can be deduced from the function arguments.Good point.
Aug 08 2013
On Thursday, 8 August 2013 at 18:53:47 UTC, Gary Willoughby wrote:I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D. I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/alternative-function-syntax-in-d/ I'll post to reddit in the morning.The second non-member function example is part of the -property controversy. foo = 123; // called as foo(123) Not sure if you'd want that mentioned.
Aug 08 2013
s/quiet easily/quite easily/g Nice article. I wish C++ had UFCS... On 8 August 2013 20:40, Jesse Phillips <Jesse.K.Phillips+D gmail.com> wrote:On Thursday, 8 August 2013 at 18:53:47 UTC, Gary Willoughby wrote:-- -=Miles Stoudenmire=- miles.stoudenmire gmail.com estouden uci.edu http://itensor.org/miles/I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D. I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/**alternative-function-syntax-**in-d/<http://nomad.so/2013/08/alternative-function-syntax-in-d/> I'll post to reddit in the morning.The second non-member function example is part of the -property controversy. foo = 123; // called as foo(123) Not sure if you'd want that mentioned.
Aug 08 2013