Hi,

I'm working through Clojure for the Brave and True and there's a little 
exercise at the end of Chapter 7 
<http://www.braveclojure.com/read-and-eval/>:

Create an infix function that takes a list like (1 + 3 * 4 - 5) and 
> transforms it into the lists that Clojure needs in order to correctly 
> evaluate the expression using operator precedence rules.


I ended up implementing the shunting yard algorithm 
<https://en.wikipedia.org/wiki/Shunting-yard_algorithm> in Clojure to solve 
it (65 lines, many functions), but I have the suspicion that this exercise 
isn't meant to be this complicated and that I'm missing a very obvious and 
elegant solution. What do you think?

Thanks,
Botond

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to