This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # arachne (1)
- # beginners (27)
- # boot (17)
- # cider (10)
- # cljs-dev (5)
- # cljsrn (76)
- # clojure (59)
- # clojure-austin (2)
- # clojure-brasil (1)
- # clojure-greece (76)
- # clojure-mexico (1)
- # clojure-quebec (63)
- # clojure-russia (16)
- # clojure-spec (127)
- # clojure-uk (12)
- # clojurescript (72)
- # community-development (7)
- # core-async (3)
- # core-matrix (2)
- # cursive (13)
- # datomic (8)
- # emacs (4)
- # funcool (4)
- # hoplon (148)
- # immutant (5)
- # keechma (2)
- # lambdaisland (5)
- # lein-figwheel (15)
- # leiningen (20)
- # off-topic (23)
- # om (13)
- # om-next (19)
- # onyx (11)
- # planck (11)
- # re-frame (59)
- # reagent (14)
- # rum (34)
- # specter (30)
- # spirituality-ethics (16)
- # uncomplicate (5)
- # untangled (387)
- # yada (2)
I see clojure.spec uses "named arguments" in several places (e.g.
(clojure.spec/fdef :args ... :ret ....)). Is there any convention as to when to use named arguments vs. a map? Maybe named arguments are primarily used for macros?
patrkris: my impression is that named arguments make more sense for things humans will be typing, compared to functions that are called programmatically
I don't have the sense that existing APIs with named arguments are primarily macros, but now that you bring it up I could see that being a general design principle since macros are also aimed at being used by humans
I am wondering, why isn’t it possible to add metadata to keywords? It would be very useful i think.
When we were building Reagent apps backed by a DB, we used Sente (core.async channels over WebSockets) to communicate between the front end and back end /cc @zaffy
@casperc: keywords are simple, efficient things that can be compared for identity quickly — metadata would break that.
@casperc: keywords are fast to compare because there’s only one
:foo — to support metadata, each
:foo would have to be separate.
Right, keywords don't (and won't) have metadata because they are shared
Well, I can probably work around the need for
conch and just use
clojure.java.shell instead. Can a call to
clojure.java.shell/sh be wrapped in a
future, and would that lead to it writing to the
StringWriter I provide as the
:out parallel to my existing process?
@seylerius: we found using the new ProcessBuilder API the easiest way to do that, if you're on a newish java
lein new reagent foo give me an ancient core.async dependency?
@seylerius: And it works if you add
:exclusions [org.clojure/clojure] to your
huh; can I extend an existing java type to behave like a map, in that I can look up keywords in it?
hiredman: I kinda wanted the original type to be able to participate, but I guess I just had
Lookup in my head as a protocol instead of ILookup the interface
yeah, but having a library named "wallhack" for accessing private fields takes some of the sting out of wrapping
Sorry to interrupt this discussion, I've got a quick question about clojure libs which depend on java libs. I'm trying to use Factual/geo, https://github.com/Factual/geo, and including the dependancy in project.clj doesn't seem to be enough to get it working, I'm thinking it's not compiling correctly and/or lein hasn't even downloaded the java libs to be compiled. Any thought on what I might be missing?
@hiredman: incidentally my test strings for this class were already “iddqd” and “idkfa” so I guess wallhack is OK
and what namespace are you trying to require? and do you have a stacktrace of the error (assuming the error is indicated via an exception)
I've tried their suggested:
(require '[geo [geohash :as geohash] [jts :as jts] [spatial :as spatial]])
what happens if you run
lein repl in your project, then type
(require '[geo.spatial]) in to the repl?
java.io.FileNotFoundException: Could not locate geo/spatial__init.class or geo/spatial.clj on classpath.
are you sure when you added the dependency to your project.clj you added it to the correct project.clj and in the correct place?
oh fml, emacs jumped straight to a
project.clj but from another project. I added the dep to the wrong project. thanks for helping me through my own idiocy, and it works now!