This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-18
Channels
- # beginners (123)
- # boot (3)
- # cider (6)
- # clara (1)
- # cljs-dev (139)
- # cljsrn (9)
- # clojure (59)
- # clojure-italy (5)
- # clojure-uk (41)
- # clojured (10)
- # clojurescript (67)
- # community-development (1)
- # component (2)
- # core-async (7)
- # cursive (4)
- # datomic (4)
- # defnpodcast (2)
- # fulcro (23)
- # graphql (1)
- # jobs (2)
- # leiningen (4)
- # off-topic (32)
- # portkey (7)
- # protorepl (5)
- # re-frame (19)
- # reagent (5)
- # reitit (23)
- # shadow-cljs (29)
- # slack-help (1)
- # spacemacs (1)
- # tools-deps (21)
- # unrepl (18)
I have a test case that occasionally fails, but i don't think i introduced any randomness, could someone help me take a quick look?
seems like for the test to consistently pass, I have to (:import [
before referring to UnknownHostException
in the test
previously in the (thrown-with-msg?)
form, i just directly said (thrown-with-msg? java.net.UnknownHostException ...)
directly
I have a function erroneously called to-json
, which takes a Datomic entity and simplifies/denormalizes it such that it's easier to consume from dumb clients
(dequalifies keywords, expands subentities, translates i18n
entities depending on user's language, removes sensitive attributes...)
What would be a better name? denormalize
? simplify
? dumbify
? output
? Naming things is hard.
json
has some sense but at the same time it has nothing to do with json
particularly when I use transit, not json ... 😂
I think I will go with ->client
or smth, until I find a better one : p
I ran into the same issue for conversions between clj and a database... I still think about the naming conventions as being incorrect haha
oh man...
serialize
hey, I need to attach a java annotation to a clojure function. Do I need gen-class
or deftype
for that?
Why can’t I evaluate this in a clj
repl? (It works in figwheel cljs
repl.)
#?(:clj "clj"
:cljs "cljs")
because the Clojure repl does not support conditional read. That’s only supported when reading cljc files. The cljs repl uses tools.reader with a different set of defaults.
we intentionally decided not to make that a default feature of the clojure repl, so not planning to change that. you can explicitly invoke the reader with the conditional read features enabled, or you could start your own sub repl with any reader you like
Yeah, that’s what I mean’t, if there is a way for me to allow it. I’d like to be able to evaluate forms in cljc
files, and sometimes I need them to be evaluated by the clj
session and sometimes by the cljs
session. Where should I start reading? 😃
For invoking the reader, here’s an example:
(read-string {:read-cond :allow :features #{:clj}} "#?(:clj \"clj\" :cljs \"cljs\")")
the options map turns on reader conditionals and injects the feature :clj
- you could instead say :cljs
if you want to pretend to be in ClojureScript
if you want to create a sub repl, that’s a bigger topic but ultimately boils down to calling clojure.main/repl with appropriate hooks (custom :read
option)
Thanks again. This is very helpful! I think I will need to go the sub repl path. I am writing an extension for Code where the user can switch between cljs
and clj
repl sessions for cljc
files.
Does Clojure support DTrace like in this like https://en.wikipedia.org/wiki/DTrace said,
With a supported language provider, DTrace can retrieve context of the code,
including function, source file, and line number location. Further, dynamic
memory allocation and garbage collection can be made available if supported by
the language. Supported language providers include *assembly language*, *C*, *C++*,
*Java*, *Erlang*, *JavaScript*, *Perl*, *PHP*, *Python*, *Ruby*, *shell script*, and *Tcl*.
Application providers allow DTrace to follow the operation of applications
through system calls and into the kernel. Applications that offer DTrace
application providers include *MySQL*, *PostgreSQL*, *Oracle Database*, *Oracle Grid
Engine*, and *Firefox*.
Java has btrace that integrates into DTrace https://github.com/btraceio/btrace. should theoretically work with Clojure although I don’t ever recall seeing anyone try.
I am running into a problem running 'lein repl' where after adding amazonica to my project.clj, 'lein repl' fails with 'CreateProcess error=206, The filename or extension is too long'
Anyone have ideas how I should configure jvm opts to fix this? I noted that amazonica pulled down a zillion more jar files and probably blows up the command line call lein is making behind the scenes, but I doubt it's specific to amazonica as a google search shows this problem popping up in lots of other contexts.
You could try have your root folder at a higher level, not sure if there are better solutions.
does anyone know a good clojure boilerplate project for server side? with endpoints and all..Ideally that uses datomic.
@gklijs Is there a known limitation in terms of classpath length, and does it affect some operating systems (Windoze!) and not others?
@gklijs I can rename my project and what-not to have a shorter root name, as I imagine that adds up, but it would be nice to know how to compute the maximum # of jars I can add to my classpath. This can be a serious restriction unless there is a sensible way around it.
It not the number of jars, but more likely just one with a lengthy group,name or package name. I use Mac OS myself, but ran into problems sometimes on Windows. So when working on virtualized windows or something, I like tip have something like c:/dev to put projects in, instead of using my home folder.
Hello! Is this project https://github.com/Datomic/codeq now abandoned? Are there any other similar ones (whcih perform git repo [possibly of a Clojure project] analysis in general)?
Why does adding 'amazonica' make it blow up but not anything else? I can only imagine it has to do with the huge # of jars it imported as dependencies.
I don’t see any evidence that CLJ-1852 is the culprit here. Could be, but could be something else too. Have you tried just printing the classpath with lein classpath
and using Java directly?
Anyone know a macro(?), which checks not a general expr, but has access to last result:
(let [x (expr)] (when (f1 x) (let [y (expr2 x)] (when (f2 y) (expr3 y)))))
=> (cond-result-> (expr) f1 expr2 f2 expr3)
@alexmiller This is far from scientific, but without 'amazonica' 'lein classpath' fills up ~4.25 pages of a new default Google doc. With 'amazonica' it fills a full 9 pages. So, 'amazonica' slightly more than doubles the size of my classpath with all its dependencies.
did you try using that classpath to run java -cp <classpath> clojure.main
?
is there more to the error? stack trace?
the big difference is lein repl is first trying to compile a CLJS front end (due to my configuration in project.clj). So the path to doom is slightly different as it's invoking the CLJS compiler when this happens via 'lein repl'.
Is there a clojure.walk/postwalk-replace
that only replaces the first instances found and leaves the rest untouched?