HaxeManual
HaxeManual copied to clipboard
Changed description of function
"a compound type of several arguments and one return" may be misunderstood as "one return statement", but in fact it means "one return value". Also, there might be no return value, i.e. [Any]->Void
This leads to the old "is Void a type" discussion. I agree the original isn't 100% accurate, but IMO your change isn't any better (and has weird grammar). I'll leave this open as a reminder but will push a different fix.
@simn Any thoughts on this? What about:
a function which expects zero or more arguments of specific types that will return a value when called
I think it's fine to consider Void
a value here so we don't complicate the short description.
This leads to the old "is Void a type" discussion.
Whether or not it's a type, I think we can all agree it's a return type. Which suggests a simple change:
- Function: a compound type of several arguments and one return type
Or for consistency:
- Function: a compound type of several argument types and one return type
Or if you're fine leaving out the reference to "compound type":
- Function: a collection of argument types plus one return type
Or to make it clearer that we're talking about the function type and not a function definition:
- Function: a function signature, consisting of a number of argument types plus a return type
...but that doesn't quite fit the rest of the page. The rest of the page draws less distinction between the type and the value stored in a variable of that type. Perhaps this would fit better:
- Function: a Haxe function, with known argument types and return type