What is this strange alias syntax?

Stewart Gordon smjg_1998 at yahoo.com
Sun May 22 07:31:08 PDT 2011


On 22/05/2011 11:57, Steven Schveighoffer wrote:
> On Sat, 21 May 2011 05:15:32 -0400, Simen Kjaeraas <simen.kjaras at gmail.com> wrote:
<snip>
>> It's the old C syntax for defining function pointers. Well, without the
>> pointer. And that last part is important, because the latter example is
>> an array of function pointers, with which D has no issue.
>
> Yes, and I thought we were killing that syntax because of how horrible it is?

Indeed, that D has this notion of immediate function types is absurd:

- it's mostly undocumented; indeed, no mention of it on type.html
- there's no native D syntax for it, only the kludgy syntax inherited from C
- it seems silly to have a type that you can't declare variables of and that (unlike void) 
has no obvious practical reason for its existence
- it leads to such corner cases as
   http://d.puremagic.com/issues/show_bug.cgi?id=3650

Stewart.


More information about the Digitalmars-d-learn mailing list