This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-12
Channels
- # alda (3)
- # beginners (17)
- # boot (157)
- # cider (15)
- # cljs-dev (30)
- # cljsjs (4)
- # cljsrn (5)
- # clojure (70)
- # clojure-austin (3)
- # clojure-canada (2)
- # clojure-colombia (1)
- # clojure-czech (1)
- # clojure-dev (27)
- # clojure-greece (34)
- # clojure-japan (6)
- # clojure-russia (114)
- # clojure-sg (3)
- # clojure-uk (8)
- # clojurescript (63)
- # cursive (9)
- # datomic (40)
- # devcards (11)
- # euroclojure (4)
- # events (8)
- # hoplon (61)
- # incanter (1)
- # instaparse (16)
- # jaunt (6)
- # jobs (6)
- # jobs-discuss (52)
- # ldnclj (1)
- # leiningen (2)
- # off-topic (3)
- # om (73)
- # onyx (101)
- # overtone (25)
- # re-frame (18)
- # reagent (6)
- # ring (7)
- # ring-swagger (36)
- # spacemacs (5)
- # sydney (1)
- # untangled (41)
- # yada (6)
so, I have the following form in some code I wrote:
(let [[rightOperand operands] (pop operands)]
(let [[leftOperand operands] (pop operands)]
(recur operators (push operands ( list operator leftOperand rightOperand)))
))
It’s not common; let forms allow multiple bindings that are evaluated in order and can refer to prior bindings
The rebinding of operands
might be confusing, but it could be a reasonable choice
so
(let [[rightOperand operands] (pop operands)
[leftOperand operands] (pop operands)] … )
Yeah, that should work
working through Clojure for the Brave & True and finally completed the infix->prefix converter in Chapter 7
@dancrumb: that was the hardest exercise so far for me 😉 I even had to look up the shunting-yard algorithm