Skip to content

Conversation

@matt-cornell
Copy link
Collaborator

As intrinsics are used for more things, writing them as functions can quickly become verbose. In addition, it goes against the more natural left-to-right flow of information if they're being called like functions.

To remedy this, an alternate syntax is proposed. @intrin(x) can be written as x.@intrin. While this may not seem significant for a single call, take a more advanced example:

allocate(@size_align(@type(x))); # fairly clear, but a lot of parentheses. also requires you to read right to left.
allocate(x.@type.@size_align); # clear and concise, read left to right. draws more attention to the object that these are an attribute of, not the intrinsic itself.

@matt-cornell matt-cornell self-assigned this Jan 8, 2024
@matt-cornell
Copy link
Collaborator Author

Merged from main to fix @treemcgee42's linking errors.

@matt-cornell matt-cornell merged commit b891857 into main Jan 16, 2024
@matt-cornell matt-cornell deleted the postfix-intrinsics branch January 16, 2024 16:18
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.

3 participants