This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-13
Channels
- # aws-lambda (7)
- # beginners (80)
- # boot (134)
- # cider (11)
- # cljs-dev (5)
- # cljsjs (3)
- # cljsrn (19)
- # clojure (144)
- # clojure-austin (2)
- # clojure-berlin (3)
- # clojure-greece (6)
- # clojure-italy (3)
- # clojure-russia (95)
- # clojure-spec (57)
- # clojure-uk (120)
- # clojure-za (2)
- # clojurescript (71)
- # component (1)
- # css (1)
- # cursive (22)
- # datascript (2)
- # datomic (101)
- # dirac (9)
- # docker (3)
- # emacs (10)
- # events (2)
- # immutant (3)
- # leiningen (2)
- # om (63)
- # om-next (1)
- # onyx (6)
- # pedestal (55)
- # portland-or (3)
- # protorepl (2)
- # re-frame (30)
- # reagent (10)
- # ring-swagger (1)
- # rum (31)
- # spacemacs (5)
- # specter (9)
- # untangled (90)
- # vim (46)
- # yada (2)
@kamillelonek If you're using leiningen it has a feature called checkout dependencies. You make a directory on the project root called "checkouts" and make a symlink inside that points to the library you want to use.
https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies
Right, I just saw that that's what you tried already... That's strange, it works on my machine ¯\(ツ)/¯
But just a next question: proto-repl doesn’t seem to be able to execute the “hello-world-test” tests from the very first exercism project. ‘lein test’ runs perfectly fine (although it still fails of course :D)
Okay and another question which is very weird… I overloaded the “Hello” function so it looks like this:
(defn hello
([] "Hello, World!")
([username] (format "Hello, %s!" username)))
Now, lein test
runs perfectly, but if I want to evaluate (hello)
or (hello “test”)
, I get a CompilerException java.lang.RuntimeException: Unable to resolve symbol: hello in this context
this will probably be more lispy 🙂
(defn hello
([] "Hello, World!")
([username] (str "Hello " username "!")))
^ you don't have to format it like what we've gotten used to other PLs that need string interpolation, we just trea them as a list (the first one being always a function and the rest as args)
I had tried that first, as that was what I expected, but I failed on myself there, not in the language… 🙂
I'd like to learn how to work with collections and nosql databases, but I'm not sure which db to use. Can anyone suggest one that has a solid clojure library?
the result seems to come back as a HashSet which I'm able to flatten to a LazySet but retractEntity wants a List or a Map
A tip might be to try and evaluate [:db.fn/...]
in your editor (not the transact part, just the vector.
That's why it was complaining about the transactions not being lists. Because it was expecting everything inside the list, to also be a list. But it was instead getting :db.fn/retractEntity
. Hence "not a list"
Yeah. There's a trick to reading stack traces, don't worry. You'll get the hang of it 🙂
im using atom so i would have to fire up the repl which is almost slower than just trying it in code heh
Odd. I tend to have a REPL running the whole time I'm developing. You might want to look into that.
oh i just mean i dont have the repl running, i should just keep it running like you're saying - that would be faster
ok so progress, now im getting
:cause :db.error/invalid-lookup-ref Invalid list form: [17592186045443, 17592186045427, 17592186045446, 17592186045431, 17592186045449, 17592186045434, 17592186045452, 17592186045437, 17592186045440]
This would be much easier to demonstrate if you could test this in the REPL. I'll give you the answer this time 🙂.
So, the result of of (flatten (into [] result))
will be something like (1 2 :foo :bar)
. So the transaction you're creating is [:db/retractEntity (1 2 :foo :bar)]
but I think you actually want [:db/retractEntity 1 2 :foo :bar ]
I think what you want to do to get your transaction is this (into [:db/retractEntity] result)
https://www.youtube.com/watch?v=FihU5JxmnBg @jgh this helped me a lot with debugging this sort of stuff
ok i think i see what im doing wrong - retractEntity should do 1 id at a time, so I think what I need is more like [[:db.fn/retractEntity first-id] [:db.fn/RetractEntity second-id]]
or something along those lines
so i suppose in that case my question becomes how could i apply a field to each element of a sequence then
ok so im able to almost get there with something like (into [] (interleave (repeat :test) [1 2 3]))
which gives me [:test 1 :test 2 :test 3]
but i need to get it into the form [[:test 1] [:test 2] [:test 3]]
If I have a list like [1 2 3]
I want to transform each element via (fn [x] [:db.fn/retractEntity x])