-
-
Notifications
You must be signed in to change notification settings - Fork 691
add new function type syntax (closes #4799) #6645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The grammar part looks good to me. I don't know about CTNamed though. Shouldn't this be integrated into CTFunction instead? IIRC you wanted to do that for CTOptional as well at some point. |
|
Yes that's an unresolved question in the proposal, but since noone commented on that, I went with the least intrusive change. Do we want to rework |
|
We could maybe keep CTOptional because at least it parses on its own and can be used in macros. With CTNamed, it doesn't even parse on its own, so it doesn't make much sense to have a representation for it. |
|
So, |
|
That looks correct. |
5466376 to
e9d257d
Compare
|
See #6667 |
|
We can close this one, right? |
|
If we're sure we go with the |
|
Hmm, I would leave `TFunction( args : Array<ComplexType>, ret : ComplexType
)` as-it, and add `TNamedFunction( args : Array<{ name : String, t :
ComplexType, opt : Bool }>, ret : ComplexType );` (or some other
constructor name) for the sake of macro compatibility
…On Wed, Oct 11, 2017 at 10:36 AM, Dan Korostelev ***@***.***> wrote:
If we're sure we go with the CTFunction change :)
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#6645 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA-bwGkue8qqy7PhwnUzf6U-CUBZN9Pdks5srH4CgaJpZM4Pv0PE>
.
|
|
That would be annoying because you would have to handle both constructors whenever you want to handle a function. It would also still be breaking because it's an additional constructor and causes exhaustiveness errors. Unless you use default cases, in which case you would just silently miss it and your code would break. |
|
We can always pass TNamedFunction from compiler to macro, but accept both from macro. |
|
That sounds awkward... in that case, the CTNamed approach strikes me as better. |
|
Maybe yes.
…On Wed, Oct 11, 2017 at 6:01 PM, Simon Krajewski ***@***.***> wrote:
That sounds awkward... in that case, the CTNamed approach strikes me as
better.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#6645 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA-bwBBjH-oAV4hOL62X_KG312ABh_dhks5srOZLgaJpZM4Pv0PE>
.
|
e9d257d to
13af32b
Compare

This implements HaxeFoundation/haxe-evolution#23