Skip to content
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

allow for aggregate adornments to be attached to the type rather than the identifier #5

Open
HalosGhost opened this issue Apr 20, 2016 · 0 comments

Comments

@HalosGhost
Copy link

In C, arrays must be defined like so:

int arr [length];

However, pointers are declared with the * adorning the type and not the identifier:

int * ident;

For pointers, this means that the type-cast associated with the type declaration is symmetric, but the same is not true for arrays:

(int * )something; // looks just like `int * something;`
(int [] )something; // does not look like `int something [];`

Java—perhaps the only syntactical addition Java made that I like—added the ability for the [] to be specified immediately following the type:

int [] something;

Supporting both syntaxes allows people to choose whichever they find to be most expressive and helpful for the circumstance. It also might make hash declarations much clearer (imho):

int {string} some_hash;
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

No branches or pull requests

1 participant