Skip to content

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

@HalosGhost

Description

@HalosGhost

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions