Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Casting between ints and floats (and the reverse) #179

Closed
hugeblank opened this issue Oct 9, 2019 · 2 comments
Closed

Casting between ints and floats (and the reverse) #179

hugeblank opened this issue Oct 9, 2019 · 2 comments

Comments

@hugeblank
Copy link

Relevant discord comment from matheus, when asking about casting:
image

Since the only primitives are ints and floats (as far as I'm aware), it would be really interesting to consolidate the functionality to a single 'cast' call, that just checks if the value is a float or an int, and then flips it to an int or float, respectively.

@plt-amy
Copy link
Member

plt-amy commented Oct 9, 2019

Since the only primitives are ints and floats (as far as I'm aware), it would be really interesting to consolidate the functionality to a single 'cast' call, that just checks if the value is a float or an int, and then flips it to an int or float, respectively.

Unfortunately this isn't doable with our type system. (Well, it might be, but the type checking overhead + chance to get it wrong just isn't worth it.)

@plt-amy plt-amy closed this as completed in 16616a1 Oct 9, 2019
@plt-amy
Copy link
Member

plt-amy commented Oct 9, 2019

I've compiled a list of all the user-facing builtins here, btw.

plt-amy added a commit that referenced this issue Oct 9, 2019
Also: add definitions for the error_message types

Closes #179
plt-amy pushed a commit that referenced this issue Jan 12, 2020
Also: add definitions for the error_message types

Closes #179
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants