As discussed in DConf2015: Python-like keyword arguments

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 4 20:26:16 PDT 2015


On Sun, 31 May 2015 09:43:50 -0400, Michel Fortin wrote:

> For that to be really useful the argument names should be part of the
> "A" type so you can forward them to another function and it still works.
> For instance:
> 
> 	void test(string a, string b="wow", string c="heh") {}
> 
> 	void forward(A...)(A a) {
> 		test(a);
> 	}
> 
> 	void main() {
> 		forward(c: "cc", a: "aa");
> 	}

i decided to not implement that for the time being. it's too intrusive, 
it requires alot of changes in AST and template processing, and outcome 
of that is almost nonexistent (at least for me).

actually, it requres new AST for "type with attached name", new mangling 
for that (to stop compiler from merging instances), and new processing 
code in various places. i see no reason to do all that work just to left 
it lay rotting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150605/9ce6a0e6/attachment.sig>


More information about the Digitalmars-d mailing list