-
Notifications
You must be signed in to change notification settings - Fork 48
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
Support usage of function types without aliasing #97
Comments
Yeah, I think that makes sense too although might be difficult to read as a return type? |
Agreed. It'd be considered best practice to alias the type for better readability, however if you are just using it trivially, you have the freedom not to. |
If it's to be in the lang then it needs to parse correctly, so I wonder if that might be an issue. Consider:
It's a bit better with mandatory ():
Still... I'm on the fence about this. Not using an alias does reduce readability quite a bit. It might be good to actually "force" the alias. |
There are a few cases where function pointer declarations are needed:
What I don't like in C is that you have to change the prototype in several places if you
In this case, the C2 solution requires more typing because it becomes:
This get worse if your code uses a lot of different function pointers in a struct. What I also don't like about C is the syntax for function pointers. The name is hidden in the So I understand your argument and agree, but I think the alternative is worse in my opinion.. |
C2 currently supports function pointer types through aliasing:
This is great, and it's a big improvement over C. However, currently, it's not possible to do the following:
Just using the function type without aliasing is not currently supported. I believe that it should be added for consistency's sake.
The text was updated successfully, but these errors were encountered: