[Issue 4530] Tidier function types

2011-06-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4530


yebblies  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||INVALID


--- Comment #6 from yebblies  2011-06-15 07:59:44 PDT ---
In the original comment, there is no 'ugly and error-prone function literal'.

There is a nested function declaration with no body.

import std.stdio;
void main() {
string a();
pragma(msg, typeof(&a));
}

Prints:
string delegate()

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4530] Tidier function types

2010-08-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4530



--- Comment #5 from bearophile_h...@eml.cc 2010-08-03 18:13:23 PDT ---
See also enhancement request 4580

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4530] Tidier function types

2010-07-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4530



--- Comment #4 from Stewart Gordon  2010-07-29 14:51:27 PDT ---
But as far as the parser is concerned, that's still a function call.  It's the
semantic analyser that identifies whether string is an actual function, a
function pointer or delegate, a type on which a static opCall is defined, an
object of a type that has an opCall, or whatever.

A function pointer declaration, on the other hand, is a syntactical form
distinct from all of these.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4530] Tidier function types

2010-07-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4530



--- Comment #3 from Sobirari Muhomori  2010-07-29 
09:21:49 PDT ---
Or a static opCall on the string type.
Or an extension method opCall(string b, int a){...}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4530] Tidier function types

2010-07-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4530


Stewart Gordon  changed:

   What|Removed |Added

 CC||s...@iname.com


--- Comment #2 from Stewart Gordon  2010-07-28 16:40:28 PDT ---
(In reply to comment #1)
> string (*a)();
> 
> which I think is pretty unambiguous.

It isn't.  Could be a function called string, which is being called with
argument (*a), and the function returned from that call then called with an
empty argument list.

D grammar aims to be unambiguous.  Removing C-style casts has already been a
step in the right direction.  Removing C-style function pointer declarations
would be another.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4530] Tidier function types

2010-07-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4530


Justin Spahr-Summers  changed:

   What|Removed |Added

 CC||justin.spahrsumm...@gmail.c
   ||om


--- Comment #1 from Justin Spahr-Summers  
2010-07-28 18:17:15 CDT ---
(In reply to comment #0)
> Allowing/keeping ugly and error-prone function literals in D2 is bad. It's
> better for D2 to keep/allow only _one_ standard, clean and readable syntax for
> functions pointers (and one for delegates, if necessary). Keeping C function
> pointer syntax or something similar in D2 causes troubles.

'a' is not a function literal... it's a declaration of a nested function. The C
syntax for a function pointer would be:

string (*a)();

which I think is pretty unambiguous.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---