Re: Should aliasing a lambda expression be allowed?

2017-11-18 Thread Timon Gehr via Digitalmars-d
On 15.11.2017 15:07, Jonathan M Davis wrote: In general, alias aliases symbols, whereas a lambda isn't a symbol. ... There is essentially no merit to the symbol/no symbol distinction. It's just a DMD implementation detail resulting in weird inconsistencies between alias declarations and

Re: Should aliasing a lambda expression be allowed?

2017-11-18 Thread Timon Gehr via Digitalmars-d
On 15.11.2017 13:28, Steven Schveighoffer wrote: However, it would be good to prevent the second alias which effectively does nothing. No. It should just overload properly.

Re: Should aliasing a lambda expression be allowed?

2017-11-16 Thread Meta via Digitalmars-d
On Thursday, 16 November 2017 at 16:10:50 UTC, Meta wrote: int function(int) f1 = (int n) => n; int function(int) f2 = (char c) => c; Should be int function(char)

Re: Should aliasing a lambda expression be allowed?

2017-11-16 Thread Meta via Digitalmars-d
On Thursday, 16 November 2017 at 13:05:51 UTC, Petar Kirov [ZombineDev] wrote: On Wednesday, 15 November 2017 at 19:29:29 UTC, Steven Schveighoffer wrote: On 11/15/17 11:59 AM, Andrea Fontana wrote: On Wednesday, 15 November 2017 at 15:25:06 UTC, Steven Schveighoffer wrote: alias foo =

Re: Should aliasing a lambda expression be allowed?

2017-11-16 Thread Petar via Digitalmars-d
On Wednesday, 15 November 2017 at 19:29:29 UTC, Steven Schveighoffer wrote: On 11/15/17 11:59 AM, Andrea Fontana wrote: On Wednesday, 15 November 2017 at 15:25:06 UTC, Steven Schveighoffer wrote: alias foo = lambda1; alias foo = lambda2; What? Yep. Would never have tried that in a million

Re: Should aliasing a lambda expression be allowed?

2017-11-15 Thread Steven Schveighoffer via Digitalmars-d
On 11/15/17 11:59 AM, Andrea Fontana wrote: On Wednesday, 15 November 2017 at 15:25:06 UTC, Steven Schveighoffer wrote: alias foo = lambda1; alias foo = lambda2; What? Yep. Would never have tried that in a million years before seeing this thread :) But it does work. Tested with dmd 2.076.1

Re: Should aliasing a lambda expression be allowed?

2017-11-15 Thread Andrea Fontana via Digitalmars-d
On Wednesday, 15 November 2017 at 15:25:06 UTC, Steven Schveighoffer wrote: alias foo = lambda1; alias foo = lambda2; What?

Re: Should aliasing a lambda expression be allowed?

2017-11-15 Thread Steven Schveighoffer via Digitalmars-d
On 11/15/17 9:07 AM, Jonathan M Davis wrote: On Wednesday, November 15, 2017 07:28:02 Steven Schveighoffer via Digitalmars-d wrote: On 11/14/17 8:56 PM, Michael V. Franklin wrote: On Tuesday, 14 November 2017 at 23:41:39 UTC, Steven Schveighoffer wrote: In fact, I'm surprised you can alias

Re: Should aliasing a lambda expression be allowed?

2017-11-15 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, November 15, 2017 07:28:02 Steven Schveighoffer via Digitalmars-d wrote: > On 11/14/17 8:56 PM, Michael V. Franklin wrote: > > On Tuesday, 14 November 2017 at 23:41:39 UTC, Steven Schveighoffer wrote: > >> In fact, I'm surprised you can alias to an expression like that. > >>

Re: Should aliasing a lambda expression be allowed?

2017-11-15 Thread Steven Schveighoffer via Digitalmars-d
On 11/14/17 8:56 PM, Michael V. Franklin wrote: On Tuesday, 14 November 2017 at 23:41:39 UTC, Steven Schveighoffer wrote: In fact, I'm surprised you can alias to an expression like that. Usually you need a symbol. It's probably due to how this is lowered. Boy did I "step in it" with my