This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-25
Channels
- # admin-announcements (6)
- # beginners (38)
- # boot (65)
- # cider (22)
- # clojure (81)
- # clojure-berlin (15)
- # clojure-india (1)
- # clojure-norway (1)
- # clojure-russia (10)
- # clojure-sg (3)
- # clojurebridge (1)
- # clojurescript (94)
- # core-typed (44)
- # editors (6)
- # euroclojure (80)
- # events (7)
- # instaparse (9)
- # jobs (2)
- # ldnclj (14)
- # off-topic (8)
- # om (3)
- # reading-clojure (6)
Now, I thought of extending ILookup
, but I can't (`extend-type` doesn't work with interfaces)
I also thought of creating a deftype
that implements ILookup
but then I have to implement Associative
as well and it gets pretty nasty...
well setting aside that I think it's a bad idea to do this in the first place, the recommended path would be to use deftype and implement the necessary interfaces
the scaffold macro is helpful to get started with this https://gist.github.com/semperos/3835392
I generally agree it's not the best idea, I wanted to make my API a bit better:
instead of writing (-> (find-items countries) (.find-items cities))
I wanted to have (-> (find-items countries) (:cities))
(`find-items` returns a record that I want to modify)
thanks for the scaffold macro... I'm not sure if I want to go this way, it looks too dirty to me
hey i have a beginner question… what is the difference between
(defmacro one [x] `’~x)
and (defmacro two [x] x)
… the whole `’~ is confusing methe simpliest explanation (though I'm not an expert in the field 😉 ) is that ` is syntax quoting, if you use it, then you have to unquote all the variables you passed in macro
if you have access to it, there's a really good book called Programming Clojure by Stuart Halloway and Aaron Bedra
and about '
symbol - I'm not sure but I think it just doesn't matter, because it resolves to symbol anyway... but somebody can correct me if I'm wrong
is there any reason to prefer referring to clojure.string/lower-case over .toLowerCase besides the nice-name?
It’s just a wrapper. Look at line 211. https://github.com/clojure/clojure/blob/41af6b24dd5be8bd62dc2b463bc53b55e18cd1e5/src/clj/clojure/string.clj