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

Make type(...) Less Hacky #7

Open
JasonSteving99 opened this issue Apr 21, 2021 · 0 comments
Open

Make type(...) Less Hacky #7

JasonSteving99 opened this issue Apr 21, 2021 · 0 comments
Labels
blocked Blocked by another issue enhancement New feature or request
Projects

Comments

@JasonSteving99
Copy link
Owner

JasonSteving99 commented Apr 21, 2021

Currently the type(...) Statement is a complete hack and it simply prints out a string representation of the Claro type of an expression. Instead, it should actually be an Expression instead of a Statement and it should return a meta value which is of type Type. This would allow higher order programming allowing type "reflection".

This is currently done entirely at compile-time and I don't think that's what a user wants when they call type(...), they want runtime information. We need to make sure that all Claro builtins support the getClaroType() method, and at runtime we should be deferring to that method to determine the type.

We'll come up with some standardized way to reference non-Claro types later after native Java interop is supported. For now we should hunt down and kill all non-Claro-native types and replace them with a Claro equivalent in order to make runtime type checking a supported feature across all types at least until Java interop happens in some magical future.

@JasonSteving99 JasonSteving99 created this issue from a note in Claro Lang (Backlog) Apr 21, 2021
@JasonSteving99 JasonSteving99 moved this from Backlog to Low priority in Claro Lang Apr 21, 2021
@JasonSteving99 JasonSteving99 added blocked Blocked by another issue enhancement New feature or request labels Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by another issue enhancement New feature or request
Projects
Claro Lang
Low priority
Development

No branches or pull requests

1 participant