This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-09
Channels
- # admin-announcements (1)
- # beginners (78)
- # boot (36)
- # cider (13)
- # cljs-dev (15)
- # cljsjs (3)
- # cljsrn (10)
- # clojure (99)
- # clojure-austin (1)
- # clojure-australia (1)
- # clojure-italy (14)
- # clojure-korea (17)
- # clojure-norway (1)
- # clojure-russia (42)
- # clojure-sg (1)
- # clojure-spec (50)
- # clojure-uk (80)
- # clojurebridge (24)
- # clojurescript (83)
- # community-development (10)
- # conf-proposals (36)
- # core-async (12)
- # cursive (20)
- # datomic (38)
- # hoplon (63)
- # lambdaisland (2)
- # leiningen (6)
- # nyc (2)
- # om (54)
- # om-next (52)
- # onyx (129)
- # planck (15)
- # re-frame (38)
- # reagent (2)
- # rethinkdb (8)
- # specter (1)
- # untangled (2)
didibus i guess no, is slack API open for everyone?
you need some bot to evaluate expression
@dominicm what is this magic?
I see
Hi guys. A real beginners question here. Im using cursive with intellij and trying to get some kind of hot reloading env setup.
(defproject natbox "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]]
:profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
:source-paths ["dev"]}})
this is my project.clj… I assume now that I need to make a cursive repl and specify the dev profile… But when I do, I get the following error
Error loading clojure.tools.nrepl.server: Could not locate clojure/tools/nrepl/server__init.class or clojure/tools/nrepl/server.clj on classpath.
Error loading complete.core: Could not locate complete/core__init.class or complete/core.clj on classpath.
Exception in thread "main" java.lang.ClassNotFoundException: clojure.tools.nrepl.server, compiling:(/private/var/folders/9s/txldqs4x1ts59q6qblrn133c0000gn/T/form-init6119612237788758823.clj:1:773)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6875)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6269)
…
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.ClassNotFoundException: clojure.tools.nrepl.server
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
... 33 more
Process finished with exit code 1
Exception starting REPL: java.lang.InterruptedException
@alexisvincent Do you get that same error running lein repl on the command line?
lein repl?
note this is when i specify in the repl config the profile dev.
running normally works perfectly
does anyone know what i need to do to get support for the new ::foo/bar
syntax that clojure.data.xml
now uses? i've tried using clojure 1.9.0-alpha12 and it gives me "RuntimeException Invalid token: ::foo/bar clojure.lang.Util.runtimeException (Util.java:221)"
if i run ‘lein repl’ it works. Also, if I start the repl through cursive without specifying the dev profile it works
Should I be specifying a profile when I start the repl ?
@alexisvincent If you do lein with-profile dev repl
does that work?
@alexisvincent Sorry, lein with-profile +dev repl
You probably want +dev
which will add that profile to the defaults, rather than dev
which will replace the defaults with that profile only
@cfleming Thanks so much man +dev is what I wanted. Ok, so I assume theres ‘default’ profile? And you can merge profiles in? I’m really really new
@cfleming Your profile picture is brilliant. Ok, repl starts properly. But not sure its doing what I want it to. I have the following files in dev/ user.clj
(ns user)
(defn dev
"Load and switch to the 'dev' namespace."
[]
(require 'dev)
(in-ns 'dev))
and dev.clj
(ns dev
"Tools for interactive development with the REPL. This file should
not be included in a production build of the application."
(:require
[ :as io]
[clojure.java.javadoc :refer [javadoc]]
[clojure.pprint :refer [pprint]]
[clojure.reflect :refer [reflect]]
[clojure.repl :refer [apropos dir doc find-doc pst source]]
[clojure.set :as set]
[clojure.string :as str]
[clojure.test :as test]
[clojure.tools.namespace.repl :refer [refresh refresh-all]]
[natbox]))
(def system
"A Var containing an object representing the application under
development."
nil)
(defn init
"Creates and initializes the system under development in the Var
#'system."
[] (natbox.system))
(defn start
"Starts the system running, updates the Var #'system."
[])
;; TODO
...
am I right in assuming user.clj will be loaded automatically and then i can run (dev) and start developing?Here’s the doc on profiles, it talks about adding, removing and defaults: https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md
If you’re really keen once you have that working, you can assign commands to keys like this: https://cursive-ide.com/userguide/repl.html#repl-commands
@cfleming I have a working system now i think 🙂 awesome stuff. Thanks I’ll check that out. what do you use?
Is it necessary to run (dev). Or is there a way to automatically do it on startup
@alexisvincent I use Cursive, but I’m biased because I develop it 🙂
@cfleming haha. I see. Thats funny. I watched a talk of yours a yesterday. I mean you said you don’t use namespace
Oh right, I just use Cursive’s reloading capabilities. When I’m testing, I can’t easily just restart the app (since it’s a whole IntelliJ) so the reloaded pattern doesn’t work so well for me. When loading files Cursive does all the transitive loading that tools.namespace would do.
Oh interesting. Oh well. Going to go ahead and try get this going now
Thanks for the help 😄
In reading an old thread regarding the clojure compiler “single-pass” behavior (https://groups.google.com/forum/#!topic/clojure/x99HZ1KEcwE) I come across this:
> The world contains cyclic dependencies. Not all relationships are hierarchical.
can someone give an example of a valid use case for cyclic dependencies? I was under the impression that whenever you have cyclic dependencies between A and B, you have a C hidden somewhere that you need to extract
you mean in real world or in code?
I get Error: Could not find or load main class geo.core
when running java -jar geo-standalone.jar
. I have added (:gen-class)
to my geo.core
-ns, and I’ve added
:main geo.core
:aot [geo.core]
to my project.clj
(I have no explicit profiles).
I get no warnings when compiling.
What can be wrong?Scratch that, it seems that I supplied some other args that removed geo.core from the class path
Are there are any guides you all can recommend about how to design real time systems with clojure
I am traditionally used to a RESTful backend, but I think the push style model isn’t working for me, so I wanted to try something new. Rather then the client always asking for more information, I was hoping to use something like websockets so that I can simply inform the client that there is new data
Do you usually keep like a connected client pool, and then keep track of each clients subscriptions? Then as data is published you look for all the clients in the pool who want data of this type, pass it through your auth system to make sure they should be able to access it then send it over to the client?
is there a library for "redacting" data structures, i.e. making them easier to pretty-print? My use case if pretty-printing a huge nested map on the repl.
I would guess that clojure.pprint respects *print-level*
and *print-length*
, but I am not sure
those look interesting
can you also supply a redact-fn for excessively large values?
no, although it uses multimethods so you can override parts of it if desired
particularly in cljs, if you print a fn it prints the whole source code
someone (probably Tom Faulhaber :) should write a small book about the Clojure print system
didn't know it was so powerful
I think cl-format alone might be Turing complete :)
I do not admit to understanding more than a fraction of it, despite having worked on it
@alexmiller are you waiting for a stable 1.9 before next core.async release?
just haven’t been working on it
@jr are you waiting for something in particular?
waiting for this commit to land and suppress a cljsbuild warning https://github.com/clojure/core.async/commit/43139e44b04dd09bb5faa555ea8ebd2ca09e25ce
@alexmiller cl-format is almost certainly turing complete assuming it actually matches the common-lisp format spec. It has conditions and loops.
Hmm... not sure if it has "the ability to change an arbitrary amount of memory (e.g., the ability to maintain an arbitrary number of variables)."
@jr I can do a rev for that
@alexmiller, pprint/with-pprint-dispatch
and`*print-length*` work perfectly for my use case, thanks!!
in cljs as well as clj. very impressive
+1 for a core.async
rev solving that warning 😉
ok, 0.2.389 is out there now
@alexmiller 🎉 thanks!
@alexmiller I’m getting a warning from this line where bounded-count
does not exist https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async.cljs#L395
I’m probably not going to be super helpful debugging the cljs side - are you using a newish cljs?
hmm. maybe it shouldn’t be excluded in cljs.
yeah, looks like I screwed that up.
stay tuned for core.async 0.2.391 :)
it’s pushed, takes about 10 minutes to be available via maven central
trying to determine how to-chan
was working in cljs before bounded-count
was added to core
yeah, that is not obvious to me either
"#lobby" sounds like the name of a general discussion channel, rather than an admin-only messages channel
@alexmiller latest release looks good. cheers!
thx, sorry for not getting it on the first try :)
@shader: did you mean to post that in #community-development ?