kanaka / mal

mal - Make a Lisp
Other
10k stars 2.53k forks source link

Floats don't work in the python implementation. #646

Closed vipenzo closed 1 month ago

vipenzo commented 11 months ago

In the python implementation float numbers are not accepted by the reader. There is a bug in reader.py at line 34 (read_atom function)

It is now: elif re.match(float_re, token): return int(token) should be: elif re.match(float_re, token): return float(token)

jero98772 commented 2 months ago

Hello , solve your problem , idk if my pull request will be accepted but here is how i solve it:

https://github.com/kanaka/mal/pull/654

i just change the line 34 to

elif re.match(float_re, token): return float(token)

kanaka commented 1 month ago

This should be resolved now. Thanks for the catch!