digitalmars.D - Keyword arguments / Named parameters library implementation
- Matthias Walter (18/18) Mar 19 2012 Hi,
- bearophile (4/7) Mar 19 2012 Regardless the implementation quality of your code, I wait for the real ...
- Matthias Walter (3/10) Mar 20 2012 I understand "the real thing" as a language implementation of keyword
- bearophile (4/6) Mar 20 2012 Right. Even if your code is good, named arguments are a feature that nee...
- Andrei Alexandrescu (3/9) Mar 20 2012 I think we're very far away from them.
- bearophile (10/11) Mar 20 2012 What do you mean? Do you mean that Matthias Walter's
- =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= (7/17) Mar 20 2012 I have to agree that a library implementation cannot provide what the
- bearophile (6/11) Mar 21 2012 With a less sleepy brain I understand, your "them" refers to the limits.
- timotheecour (1/3) Sep 09 2012
Hi, I've written a small module (at the moment called utils.keywordargs) which simulates keyword arguments (aka named parameters). The documentation can be found here, http://xammy.xammy.homelinux.net/~xammy/utils_keywordargs.html while the code is at http://xammy.xammy.homelinux.net/~xammy/keywordargs.d or in a better readable format: http://pastebin.com/AfqKKziW There was some discussion about introducing them in the language a while ago. One argument against keyword arguments was that the names become part of the interface. This wouldn't be different when using my implementation, but as the names are compile-time strings, handling different versions of a library is just a matter of putting the right string constant into the keyword argument template. Any comments? Is something like that interesting for phobos? If yes, I'd suggest to put it on github to make further work easier. Best regards, Matthias
Mar 19 2012
Matthias Walter:I've written a small module (at the moment called utils.keywordargs) which simulates keyword arguments (aka named parameters). The documentation can be found here,Regardless the implementation quality of your code, I wait for the real thing :-) Bye, bearophile
Mar 19 2012
On 03/19/2012 07:53 PM, bearophile wrote:Matthias Walter:I understand "the real thing" as a language implementation of keyword arguments instead of a library "workaround", right?I've written a small module (at the moment called utils.keywordargs) which simulates keyword arguments (aka named parameters). The documentation can be found here,Regardless the implementation quality of your code, I wait for the real thing :-)
Mar 20 2012
Matthias Walter:I understand "the real thing" as a language implementation of keyword arguments instead of a library "workaround", right?Right. Even if your code is good, named arguments are a feature that needs to be built-in, or it will not happen. Creative usage of the language has its limits. Bye, bearophile
Mar 20 2012
On 3/20/12 7:14 AM, bearophile wrote:Matthias Walter:I think we're very far away from them. AndreiI understand "the real thing" as a language implementation of keyword arguments instead of a library "workaround", right?Right. Even if your code is good, named arguments are a feature that needs to be built-in, or it will not happen. Creative usage of the language has its limits.
Mar 20 2012
Andrei Alexandrescu:I think we're very far away from them.What do you mean? Do you mean that Matthias Walter's implementation is very far from being a good enough implementation of named arguments? :-) (I have not said that named arguments are necessary. I have said that I think it's not probable that a library implementation of them will be good enough.) Hugs, bearophile
Mar 20 2012
On 20-03-2012 17:01, bearophile wrote:Andrei Alexandrescu:I have to agree that a library implementation cannot provide what the language would be able to here. Just the requirement that functions with named arguments must be templatized makes the strategy more or less unusable for class hierarchies. -- - AlexI think we're very far away from them.What do you mean? Do you mean that Matthias Walter's implementation is very far from being a good enough implementation of named arguments? :-) (I have not said that named arguments are necessary. I have said that I think it's not probable that a library implementation of them will be good enough.) Hugs, bearophile
Mar 20 2012
Andrei Alexandrescu: bearophile:With a less sleepy brain I understand, your "them" refers to the limits. I agree that probably there are several creative uses to be invented still of the currently present D features. But I don't think the creative use of the current D features will give us good enough named parameters :-) Bye, bearophileRight. Even if your code is good, named arguments are a feature that needs to be built-in, or it will not happen. Creative usage of the language has its limits.I think we're very far away from them.
Mar 21 2012
Hi, It seems these links are unavailable now:http://xammy.xammy.homelinux.net/~xammy/utils_keywordargs.html http://xammy.xammy.homelinux.net/~xammy/keywordargs.d
Sep 09 2012