This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-16
Channels
- # 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
yes, anything that might be generated programmatically is better left as a map.
@zaffy: Maybe this will help? https://e-string.com/articles/building-a-single-page-app-with-clojurescript-reagent-and-friends/
(it doesn’t include a relational DB but covers a lot of the front end stuff)
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
@seylerius: Did you check whether conch introduces dependency conflicts?
@seancorfield: Didn't check that. Good possibility.
@seancorfield: Depends on clojure 1.6.0. There we go.
why does lein new reagent foo
give me an ancient core.async dependency? [org.clojure/core.async "0.1.346.0-17112a-alpha"]
@seylerius: And it works if you add :exclusions [org.clojure/clojure]
to your me.raynes/conch
dependency?
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?
(specifically, it can't locate geo/whatever on classpath)
@hiredman: incidentally my test strings for this class were already “iddqd” and “idkfa” so I guess wallhack is OK
@hiredman: that, exactly, [factual/geo "1.0.0"]
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)
deleted a stack trace because it was a huge block of noise on this thread
I have restarted the repl
I've tried their suggested: (require '[geo [geohash :as geohash] [jts :as jts] [spatial :as spatial]])
[geo.spatial :as spatial]
(require '[geo.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.
(from fresh repl too)
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!
@seylerius: I use conch just fine on clojure 1.7 and 1.8. Cider is fine as well. Maybe some other toxic interaction going on??