-
Notifications
You must be signed in to change notification settings - Fork 89
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
[Feature] Add integer type #443
Comments
Referring to #442, would you need union type support, e.g. for the standard library function that sums all numbers:
Alternatively, what would it take to make the engine support something like class inheritance, where |
@hdwalters I think that This means that we can just do:
Since Int can be easily treated as Num without any modifications (at least for now) |
i think we should add it as an opt-in to tell the compiler to optimize away some things, while still setting whole numbers as |
i suppose that every math operation with how do we handle situations when an |
|
@b1ek How would you handle this situation under the hood:
Where |
i'd have the user cast the types to one and throw a compile error if they mismatch |
Is your feature request related to a problem? Please describe.
Amber has no way to represent integer types. Sometimes we may want to accept type that can be represented as an integer. Here are main pros:
bc
installedbc
will only slow things downDescribe the solution you'd like
Int
data type.
symbol is aNum
Int
Int
instead ofNum
Int
instead ofNum
Int
data typeDescribe alternatives you've considered
N/A
Additional context
#70
The text was updated successfully, but these errors were encountered: