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

[Stdlib] Add type check macros #470

Open
alexmozaidze opened this issue Nov 17, 2023 · 1 comment
Open

[Stdlib] Add type check macros #470

alexmozaidze opened this issue Nov 17, 2023 · 1 comment
Labels
blocked Waiting on another issue/milestone/task enhancement

Comments

@alexmozaidze
Copy link

alexmozaidze commented Nov 17, 2023

Having simple macros like string?, number?, table?, nil?, etc. would increase the readability of code that may use them.

The only thing I'm worried about is the existing table? in macro context. iirc, it checks if an AST node is a table literal, as opposed to runtime type of table. I think it wouldn't be unreasonable to rename AST checking macros to be: table-literal?, sequence-literal?, etc.

@technomancy
Copy link
Collaborator

The big problem here is that it will almost certainly conflict with existing identifiers in a large number of existing codebases. Until we have a mechanism to opt in to new built-in macros, I don't think we can introduce these as it will be a breaking change.

@technomancy technomancy added enhancement blocked Waiting on another issue/milestone/task labels Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting on another issue/milestone/task enhancement
Projects
None yet
Development

No branches or pull requests

2 participants