This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-31
Channels
- # arachne (4)
- # beginners (21)
- # boot (36)
- # cider (59)
- # cljsrn (8)
- # clojure (260)
- # clojure-filipino (3)
- # clojure-greece (3)
- # clojure-italy (15)
- # clojure-russia (58)
- # clojure-spec (54)
- # clojure-uk (99)
- # clojureremote (5)
- # clojurescript (65)
- # core-matrix (1)
- # cursive (17)
- # data-science (9)
- # datascript (7)
- # datomic (33)
- # emacs (8)
- # hoplon (2)
- # jobs (1)
- # jobs-discuss (2)
- # lein-figwheel (2)
- # lumo (2)
- # numerical-computing (1)
- # off-topic (22)
- # om (78)
- # onyx (17)
- # parinfer (3)
- # pedestal (5)
- # perun (1)
- # powderkeg (19)
- # protorepl (37)
- # re-frame (3)
- # rum (2)
- # spacemacs (1)
- # uncomplicate (8)
- # unrepl (78)
- # untangled (29)
- # yada (41)
is there any way to make a #()
function that doesn't use it's arguments? For example, this throws an arity exception:
(map #(identity 1) (range 5))
You could use (fn [_] (identity 1))
instead.
(so I guess the answer is "no, but...")
yeah, I ended up using (fn [_] 1)
, but was just wondering if there was something I didn't know
Heh, I wasn't sure whether @rgdelato really meant to replace elements with 1 or that was just a dummy function body. constantly
is a good option if that's the intent @madstap ๐
yeah, the specific example was translating this silly Haskell thing:
sum (map (\x -> 1) "Hello there")
...but I've actually wondered for a while about arity in #()
functionsthat was (map #(do % 1) (range 5))
which is cheating a bit ๐
so i'm a bit annoyed about a pattern i'm seeing in clojure, and organising my named keywords (e.g. for spec).
so, let's assume i have an event
, and an event has several attributes (such as type, id, whatever). when speccing these things out, i end up with namespaces keywords such as these:
:my.app/event
:my.app.event/type
:my.app.event/id
the problem being, i would prefer to put them all in one file, src/my/app/event.clj
. but then referring to the my.app/event
keyword becomes awkward, since i would prefer to use ::event or something.
how are others solving this problem ? just accept the fact that it's sometimes going to be awkward ?can't find any documentation regarding the usage... maybe someone has some experience with this
Hi! Just getting started with Clojure. I'm making a bunch of errors with namespaces. Any recommended reading?
@nonrecursive is the author, all thanks go to him ๐
Hi, could you help me where can I find a great tutorial about Google Charts and controllers with Clojure? or Library for this?