Re: Walter, I need a __trait please.

2016-03-19 Thread ZombineDev via Digitalmars-d
On Wednesday, 16 March 2016 at 11:45:28 UTC, ZombineDev wrote: ... "You DON'T want to expose your compiler implementation to the language." ironically, it looks like there is a company whose business is solely based on this idea (https://www.postsharp.net/aop.net/compiletime-weaving) and it

Re: Walter, I need a __trait please.

2016-03-19 Thread ZombineDev via Digitalmars-d
On Tuesday, 15 March 2016 at 23:04:59 UTC, deadalnix wrote: On Tuesday, 15 March 2016 at 19:59:01 UTC, deadalnix wrote: On Tuesday, 15 March 2016 at 11:47:20 UTC, ZombineDev wrote: Instead I think that if we improve D's existing introspection capabilities and expose the compiler as a library at

Re: Walter, I need a __trait please.

2016-03-16 Thread Dejan Lekic via Digitalmars-d
On Wednesday, 16 March 2016 at 04:47:05 UTC, cy wrote: I'd honestly worry more about the compiler hiding implementation, that could have been used to make things easier for programmers. You worry too much.

Re: Walter, I need a __trait please.

2016-03-15 Thread cy via Digitalmars-d
On Tuesday, 15 March 2016 at 19:59:01 UTC, deadalnix wrote: It is like one of these simili good idea that everybody tries and everybody regrets it. You DON'T want to expose your compiler implementation to the language. I'm sorry, but I know a lot of people who don't expose their compiler impl

Re: Walter, I need a __trait please.

2016-03-15 Thread ZombineDev via Digitalmars-d
On Tuesday, 15 March 2016 at 19:59:01 UTC, deadalnix wrote: On Tuesday, 15 March 2016 at 11:47:20 UTC, ZombineDev wrote: Instead I think that if we improve D's existing introspection capabilities and expose the compiler as a library at compile-time, we will have a much powerful system than any

Re: Walter, I need a __trait please.

2016-03-15 Thread deadalnix via Digitalmars-d
On Tuesday, 15 March 2016 at 19:59:01 UTC, deadalnix wrote: On Tuesday, 15 March 2016 at 11:47:20 UTC, ZombineDev wrote: Instead I think that if we improve D's existing introspection capabilities and expose the compiler as a library at compile-time, we will have a much powerful system than any

Re: Walter, I need a __trait please.

2016-03-15 Thread Jacob Carlborg via Digitalmars-d
On 15/03/16 12:47, ZombineDev wrote: Hi Jacob, I've been thinking quite a bit about the next step in the evolution of D's metaprogramming, and I thought that AST macros are the best way forward, however since then I become convinced that macros are a distraction from a much more powerful langua

Re: Walter, I need a __trait please.

2016-03-15 Thread deadalnix via Digitalmars-d
On Tuesday, 15 March 2016 at 11:47:20 UTC, ZombineDev wrote: Instead I think that if we improve D's existing introspection capabilities and expose the compiler as a library at compile-time, we will have a much powerful system than any potential macro system, for a fraction of the complexity.

Re: Walter, I need a __trait please.

2016-03-15 Thread ZombineDev via Digitalmars-d
On Tuesday, 15 March 2016 at 08:02:34 UTC, Jaocb Carlborg wrote: On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the par

Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
foreach (p;__traits(lambda, (x,y) => x < y)) { writeln(p); } would output x y x < y If something like that would be merged I can implement this now I guess. thanks for the PR link Jacob

Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 March 2016 at 08:02:34 UTC, Jaocb Carlborg wrote: On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: [...] To get the parameters as as strings, I think this [1] will allow you to that. To get the body as a string, that sounds almost as AST macros :) [1] https://gi

Re: Walter, I need a __trait please.

2016-03-15 Thread Jaocb Carlborg via Digitalmars-d
On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the parmeters of a lambda as AliasSequence. e.g foreach (p;__traits(lam

Re: Walter, I need a __trait please.

2016-03-15 Thread Jaocb Carlborg via Digitalmars-d
On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the parmeters of a lambda as AliasSequence. e.g foreach (p;__traits(lam

Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 March 2016 at 03:10:46 UTC, Nicholas Wilson wrote: On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the pa

Re: Walter, I need a __trait please.

2016-03-14 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the parmeters of a lambda as AliasSequence. e.g foreach (p;__traits(lam

Walter, I need a __trait please.

2016-03-14 Thread Stefan Koch via Digitalmars-d
Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the parmeters of a lambda as AliasSequence. e.g foreach (p;__traits(lambda, (x,y) => x < y)) { writeln(p); } would output x y x < y I