Re: Arithmetic simplifier

2018-08-29 Thread bernardH
gt; Hi, > I am ne to Clojure, and trying to make arithmetic simplifier > so it can take string in for `1x + 3y -4x + 8 -1y` and return "-3x + 2y +8" > Currently, I am stuck with a `make-ast` function, where load-string loads. > it can't load string with variables

Arithmetic simplifier

2018-08-22 Thread Jason Kapp
Could use instaparse (https://github.com/Engelberg/instaparse) to parse the input. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please b

Re: Arithmetic simplifier

2018-08-20 Thread Ivan Pierre
That's normal read-string is : Sequentially read and evaluate the set of forms contained in the string So you have to read EVERY S-expressions in a loop. BUT 1x is not an S-Expr... Trying a number, but x doesn't work, Trying a symbol, but 1 as first char doesn't work. The best way is to read

Arithmetic simplifier

2018-08-18 Thread ckryvomaz
Hi, I am ne to Clojure, and trying to make arithmetic simplifier so it can take string in for `1x + 3y -4x + 8 -1y` and return "-3x + 2y +8" Currently, I am stuck with a `make-ast` function, where load-string loads. it can't load string with variables. (def preced