Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

This reminds me I should actually write a "natural" arithmetic expression parser for my Rust crate realistic

Right now, realistic can parse "(* (^ 40 0.5) (^ 90 0.5))" and it will tell you that's 60, because yeah, it's sixty, that's how real arithmetic works.

But it would be nice to write "(40^0.5) * (90^0.5)" or similar and have that work instead or as well. The months of work on realistic meant I spent so long without a "natural" parser that I got used to this.



I think having a polish notation parser is good enough for math-y applciations, I wouldn't worry about it too much if I were you. Nice crate by the way!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: