yurtsiv / mooncake

🌜 A functional, dynamic programming language
MIT License
12 stars 4 forks source link

Dividing Integer and Float results in unexpected error #9

Closed mateidanut closed 3 years ago

mateidanut commented 3 years ago
let f = 41
let h = 2.5
f / h

output: src/Interpreter/Eval.hs:(15,1)-(92,33): Non-exhaustive patterns in function evaluate

expected output: user error ("Can divide only integers")

This may mean the Parser part does not expect this construct.

yurtsiv commented 3 years ago

Thank you for filling out the issue @mateidanut.

I was in the middle of adding floats and implemented only the parser side. The error you see comes from the interpreter which doesn't handle floats yet. There're two failing tests currently which may confuse people, so we should either remove them or actually implement floats.

Let me know if you're willing to work on either of that, otherwise, I'll do it :)

mateidanut commented 3 years ago

Hey @yurtsiv thanks for the reply! I noticed that the test suite didn't pass because of the 2 float tests so I removed them in PR #8. Let me know what do you think when you get to have a look.

Cheers!

yurtsiv commented 3 years ago

@mateidanut Aaah, I see. Let's have them commented out for now. Thanks!