This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-23
Channels
- # announcements (4)
- # bangalore-clj (1)
- # beginners (56)
- # cider (24)
- # clojure (71)
- # clojure-dev (21)
- # clojure-nl (2)
- # clojure-russia (1)
- # clojure-spec (5)
- # clojure-uk (10)
- # clojured (8)
- # core-logic (18)
- # cursive (6)
- # data-science (15)
- # duct (1)
- # figwheel-main (4)
- # fulcro (6)
- # graphql (2)
- # luminus (4)
- # nrepl (9)
- # off-topic (10)
- # pathom (10)
- # pedestal (3)
- # re-frame (10)
- # ring-swagger (1)
- # shadow-cljs (19)
- # vim (35)
Hello!
I'm trying to work through latest edition of the The Reasoned Schemer in Clojure and I'm encountering some Scheme syntax I don't quite know how to translate.
(run* [q]
(== `(((,q)) pod) '(((pea) pod))))
(run* [q]
(== '(((pea)) pod) `(((pea)) ,q)))
are analogues for chapter 1, frame 33 and 34, and should associate q with pod and
pea, respectivelyHowever, I'm getting ()
for both when I eval then with CIDER. Am I doing something incorrectly?
Awesome, thank you~
Wonderful, that's working~
(run* [q]
(fresh [x]
(== `(~x) q)))
HM, I still must have something wrong because these two are evaluating incorrectly:
(run* [q]
(== '(((pea)) pod) `(((pea)) ~q)))
(run* [q]
(fresh [x]
(== `(((~q)) ~x) `(((~x)) pod))))
ie. the first pea
is a regular non-namespaced symbol but the second expands to your-ns/pea
(run* [q]
(== [[['pea]] 'pod] [[['pea]] q]))
(run* [q]
(fresh [x]
(== [[[q]] x] [[[x]] 'pod])))
Cool, thank you -- I'll try replacing the lists with vectors when I hit a snag like this again.
Awesome, I was able to get through chapter 1! https://github.com/kellyi/clj-lisp-sandbox/blob/master/reasoned-schemer/src/reasoned_schemer/one.clj