This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-27
Channels
- # beginners (54)
- # bitcoin (2)
- # boot (1)
- # calva (10)
- # cider (30)
- # cljs-dev (25)
- # cljsrn (17)
- # clojure (27)
- # clojure-dev (16)
- # clojure-estonia (3)
- # clojure-hk (1)
- # clojure-italy (8)
- # clojure-losangeles (1)
- # clojure-nl (17)
- # clojure-russia (1)
- # clojure-spec (15)
- # clojure-uk (45)
- # clojurebridge (1)
- # clojurescript (95)
- # clojurescript-ios (1)
- # core-async (5)
- # cursive (10)
- # datomic (8)
- # emacs (2)
- # figwheel-main (31)
- # fulcro (99)
- # hyperfiddle (3)
- # immutant (1)
- # jobs (13)
- # jobs-discuss (82)
- # keechma (6)
- # leiningen (3)
- # lumo (1)
- # nrepl (1)
- # off-topic (37)
- # onyx (1)
- # pedestal (6)
- # re-frame (7)
- # reitit (2)
- # remote-jobs (1)
- # ring-swagger (3)
- # rum (6)
- # shadow-cljs (14)
- # specter (4)
- # tools-deps (27)
- # yada (12)
I haven't tried it. We're used to SQL so I haven't had much interest in trying datalog-over-JDBC.
I'm mostly interested in it because 1. I'm a SQL neophyte 2. We're writing a GraphQL service, so being able to compose queries easily is going to be important
Cool. Let us know how walkable
works out once you've tried it! π
is there a command in the cli tools to only retrieve dependencies and not start the repl? (it's for running on a build server)
@stijn also: https://clojurians.slack.com/archives/C6QH853H8/p1529594463000821 https://clojurians.slack.com/archives/C6QH853H8/p1529594787000909
If I want to have namespaces com.a.b.c
, com.a.b.d
, and com.a.b.e
(etc.), do they have to live in a com/a/b/
directory on the classpath or can I collapse the unnecessarily nested directories, e.g. com.a.b/{c,d,e}.clj
?
I tried the latter just now and I'm getting the exception below, but I'm not sure if I'm hitting a JVM limitation or just doing something wrong.
> Could not locate com/a/b/c__init.class or com/a/b/c.clj on classpath.
OK. No way around that, huh? π Thanks for the info.
@lilactown @jeff.terrell
that'd be Clojure, not the JVM. look at clojure.core/root-resource
, clojure.core/load
and of course RT/load
user=> (#'clojure.core/root-resource 'my.great.namespace)
"/my/great/namespace"
To be hyper-precise, I've seen Stuart Halloway describe this as "convention" -- you could technically put all code in one big file with (ns name ...) every so often, with namespaces honoring any dependency ordering between them, and call (load-file "filename.clj"). I've never seen anyone do that for anything, and the resource name "convention" is necessary if you use load
, require
, etc.
As per the JVM, it's the classloader that expects the bytes in a certain spot. For example, if you want to load the class 'com.foo.bar' the classloader is coded to look in that directory structure. It is, as far as I can tell, a convenience and a convention. You ask the classloader to load a class, it thinks, "Where might I find the bytes for this?"
right, but clojure namespaces can be loaded without using a classloader, via load-string or load-file for example
but once you use require or load, you need the ns file to be in a predictable place based on a classloader
Yes, just pointing out the legacy reasons for the class path structure mirroring the directory structure (for Java).
Hi there, I'm trying to figure our how to reload my code by calling clojure.tools.namespace.repl/refresh
from a file watcher invoked from the repl, but I keep getting java.lang.IllegalStateException: Can't set!: *ns* from non-binding thread
. I think this is because the file watcher I'm using (juxt.dirwatch) runs in a different thread and does the callback from there. Is there any way I can force the callback to happen in the repl/caller's own thread?
@jstaab how do you create the thread that is calling refresh?