Thanks miner!
On Friday, June 24, 2016 at 10:20:54 PM UTC+2, miner wrote:
>
> Not exactly the same problem, but you might like to see an infix
> implementation from “The Joy of Clojure” by Fogus and Chouser.
>
> http://fogus.me/fun/unfix/infix-src.html
>
> The “Joy” code makes intermediate calc
Thank you Jason, this is indeed a much nicer solution.
On Friday, June 24, 2016 at 8:51:26 PM UTC+2, Jason Felice wrote:
>
> Recursive descent parsers are much smaller for simple cases. Basically,
> you write one function per level of precedence, and each tries, greedily,
> to consume as much a
Not exactly the same problem, but you might like to see an infix implementation
from “The Joy of Clojure” by Fogus and Chouser.
http://fogus.me/fun/unfix/infix-src.html
The “Joy” code makes intermediate calculations as it goes. I tweaked it a bit
to make a data-reader that only does the infix
Recursive descent parsers are much smaller for simple cases. Basically,
you write one function per level of precedence, and each tries, greedily,
to consume as much as possible for that level of precedence. e.g.
(defn parse-level1 ;; + and -
[list]
... ; calls parse-level2 repeatedly so long