DIP6: Attributes

Rainer Deyke rainerd at eldwood.com
Tue Aug 4 14:20:53 PDT 2009


Steven Schveighoffer wrote:
> On Tue, 04 Aug 2009 15:56:16 -0400, Ary Borenszweig
> <ary at esperanto.org.ar> wrote:
>> foo(timeout=5, bar="100")
> It could also be accomplished via a fully implemented reflection
> library, which is my side topic for this thread branch :P

No.  The names of positional arguments are an implementation detail, and
should not be exposed via reflection.  Named arguments are different
from positional arguments and require separate language support.

Consider the ambiguity caused by function overloading:
  void f(int x, string y);
  void f(string y, int x);
  f(x = 1, y = "");

Consider the implications of function pointers:
  void f(int x, int y);
  void g(int y, int x);
  (cond ? &f : &g)(x = 1, y = 2);


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list