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

Decide how to handle arithmetic errors (e.g. division by 0) #3282

Closed
pbiggar opened this issue Nov 28, 2021 · 1 comment
Closed

Decide how to handle arithmetic errors (e.g. division by 0) #3282

pbiggar opened this issue Nov 28, 2021 · 1 comment

Comments

@pbiggar
Copy link
Member

pbiggar commented Nov 28, 2021

some arithmetic operations can lead to errors:

  • division by 0
  • modulus by 0

These should return Result (Int, IntError):

Int::divide(Int: a, Int: b) -> Result (Int, Error)
Int::mod(Int: a, Int: b) -> Result (Int, Error)
Int::sum(List Int: a) -> Int

One problem here is that the error rail is a little cumbersome, and so making obvious int operations use Results will make them unweildy to use. So we need to iterate on the error rail before this makes sense, practically.

@StachuDotNet StachuDotNet changed the title arithmetic errors Decide how to handle arithmetic errors (e.g. division by 0) Jun 22, 2022
@pbiggar pbiggar removed the v-next label Mar 10, 2023
@StachuDotNet
Copy link
Member

folding this into #5243

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

No branches or pull requests

2 participants