narrowtux / abacus

Parses and evaluates mathematical expressions in Elixir. Inspired by math.js
MIT License
84 stars 18 forks source link

parse_polish/1 #21

Closed ghost closed 8 months ago

ghost commented 3 years ago

This would solve #19. Negative numbers need to be written like this ( - 3 ), which results in -3. And also rn I cant write things like (+ 1 2 3), this should result in {:add, 1, {:add, 2, {:add, 3}}}. But I dont know how to implement this. Except for this everything works as expected.

narrowtux commented 3 years ago

that was quick. before I properly review it, at first glance it looks good, but I have no clue if a deep variable access in polish notation is the same as the normal notation:

foo.bar.baz vs . (. foo bar) baz