Skip to content

Conversation

@nadako
Copy link
Member

@nadako nadako commented Oct 5, 2017

@nadako nadako requested review from Simn and ncannasse October 5, 2017 23:04
@nadako
Copy link
Member Author

nadako commented Oct 5, 2017

@nadako nadako added this to the 4.0 milestone Oct 5, 2017
@Simn
Copy link
Member

Simn commented Oct 6, 2017

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.

@nadako
Copy link
Member Author

nadako commented Oct 7, 2017

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 CTFunction instead?

@Simn
Copy link
Member

Simn commented Oct 7, 2017

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.

@nadako
Copy link
Member Author

nadako commented Oct 8, 2017

So, CTFunction of (placed_name * bool * type_hint) list * type_hint?

@Simn
Copy link
Member

Simn commented Oct 8, 2017

That looks correct.

@nadako
Copy link
Member Author

nadako commented Oct 11, 2017

See #6667

@Simn
Copy link
Member

Simn commented Oct 11, 2017

We can close this one, right?

@Simn Simn closed this Oct 11, 2017
@nadako
Copy link
Member Author

nadako commented Oct 11, 2017

If we're sure we go with the CTFunction change :)

@ncannasse
Copy link
Member

ncannasse commented Oct 11, 2017 via email

@Simn
Copy link
Member

Simn commented Oct 11, 2017

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.

@ncannasse
Copy link
Member

We can always pass TNamedFunction from compiler to macro, but accept both from macro.
But maybe that's not that important given we have reification on complex types, so most of them will be transparent.

@Simn
Copy link
Member

Simn commented Oct 11, 2017

That sounds awkward... in that case, the CTNamed approach strikes me as better.

@Simn Simn reopened this Oct 11, 2017
@ncannasse
Copy link
Member

ncannasse commented Oct 11, 2017 via email

@nadako nadako force-pushed the new_function_type_syntax branch from e9d257d to 13af32b Compare October 11, 2017 20:30
@nadako nadako merged commit 6661272 into development Oct 11, 2017
@nadako nadako deleted the new_function_type_syntax branch October 12, 2017 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants