This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # ai (2)
- # beginners (12)
- # bitcoin (1)
- # boot (41)
- # chestnut (5)
- # cider (9)
- # clara (24)
- # cljs-dev (11)
- # clojure (107)
- # clojure-dev (2)
- # clojure-italy (4)
- # clojure-nl (4)
- # clojure-russia (10)
- # clojure-spec (19)
- # clojure-uk (71)
- # clojurescript (121)
- # cursive (3)
- # data-science (7)
- # datacrypt (1)
- # datomic (72)
- # docs (7)
- # duct (2)
- # emacs (3)
- # ethereum (1)
- # figwheel (1)
- # fulcro (58)
- # graphql (16)
- # hoplon (9)
- # jobs (2)
- # jobs-rus (1)
- # lein-figwheel (1)
- # leiningen (25)
- # luminus (2)
- # lumo (5)
- # off-topic (6)
- # onyx (22)
- # pedestal (3)
- # portkey (1)
- # proton (2)
- # re-frame (7)
- # remote-jobs (1)
- # ring-swagger (3)
- # rum (2)
- # shadow-cljs (38)
- # specter (7)
- # yada (30)
I need to generate an image by: 1. adding some text 2. adding some salt & pepper noise 3. add some gaussian noise 4. distort the image a bit 5. write it out as a png is quil the right library to use for this, or should I use something else ?
how do I convert "GrayF32/class" to clojure ? GrayF32 image = UtilImageIO.loadImage("test.png",GrayF32.class);
is there a way to coax cider to allow inspection of return values in the repl like SLIME? currently it seems any value returned is just syntax highlighted but is otherwise a just a string in the buffer.
how can i print to the console from .cljc files? neither
println work (which is understandable as we're not specifying a build target)
You can use something like (:require [#?(:clj clojure.spec.alpha :cljs cljs.spec.alpha :default clojure.spec.alpha) :as s]) to support both clj and cljs specific funtionality
Good day to all: I've encountered a namespace loading failure when using cloverage, which I'm not sure how to debug
Exception in thread "main" java.lang.IllegalArgumentException: Parameter declaration missing, compiling:(/tmp/form-init5334710656729606392.clj:1:73
tmp files does seem to exist anymore so I cannot inspect
and the Exception trace doesn't address any lines of my own code... I'm a bit stumped tbh
Does anyone know if temporary files like
/tmp/form-init5334710656729606392.clj:1:73 can be retained somehow?
I cannot find any obvious omissions of parameter declarations within my
Well, that wasn't much fun. By nuke all test namespaces and progressively removing clj files from my project, until cloverage worked I isolated the problem to a
(defn exist-until) - silly me.
Still it would be nice if these kinds of issues were easier to isolate - open to ideas
Seems like I was half-way through implementing a function I thought I'd need, but ended up not using it and since it was not referenced the application concerned compiles and runs fine.
cloverage wants to instrument everything, regardless of whether code is used or not...
Actually, it turns out the function was the only
(defn ...) within a new
clj file I'd created, that was not being required by any other namespace - doubly silly me. Which is why
lein run was not picking it up.
When I actually require said file, I see a helpful error message that would have enabled me to isolate the problem a lot quicker
Exception in thread "main" java.lang.IllegalArgumentException: Parameter declaration missing, compiling:(xxx/xxxx/xxxxxx/domain.clj:13:1) - just in case anyone is interested.
Hi @alexmiller, I'm reading through this article of yours on sequences and was wondering what you meant by "logical" when you said: >Sequences are logical lists http://insideclojure.org/2015/01/02/sequences/
Unlike other lisps, Clojure has an abstract representation of a list. Instead of saying a list is a cons cell, in Clojure a "list" is something that implements ISeq
Seq - something that conforms to ISeq. May be a bunch of cons cells, may be an view over a collection, etc
List - a list is technically a PersistentList which is a ISeq that also implements some other features (like O(1) counting).
So all that to say, "logical list' is a way of saying all of that ^^ while also showing that Clojure defines lists a bit differently from other lisps, or even Java.
I wrote a spec for a function, but spec can't create a generator for it. Is there any way to provide the generator for that function to spec ?
Is there a way to run
read-string to get the from from a string without evaluating the defs?
So like something to wrap around
(read-string (defn inc [x] (+ x 1))) so that clojure.core/inc doesn’t get overwritten?
that doesn't make much sense, read-string operates on strings not on data and doesn't do any evaluation
Funny, I thought
(read-string "(def inc (fn [x] (+ x 1)))") would overwrite inc but it doesn’t seem to
Something fishy’s going on in my code. Somewhere the def is being evaluated, but I thought it was just being read…
Ok, so my problem wasn’t with read-string. @bronsa, is there a way to do
(e/emit-form (ana.jvm/analyze '(def inc (fn [x] (+ x 1))))) without overwriting clojure.core/inc?
@the2bears still in the initial research/brainstorming phase, but I hope to have something releasable within a month
- clojure needs to intern vars at analysis time, to support expressions like
(def a (fn  a)), so that the var
a is reachable in the intialization body of the var def
- t.a provides a configurable
create-var function that you can replace with a no-op, so that the var won't get interned
- because t.a resolves vars using its global env map rather than inspecting directly clojure's reified namespaces, so that if you want you can make that expression analyzable w/o actually interning anything
- because side-effects can happen at macroexpansion time, including var interning and var unmapping, t.a. needs to rebuild its namespace map from clojure's reified namespaces after every macroexpansion (yes, there are actually libraries that do this sort of stuff, ugh)
- this means that the var assoced into t.a's namespace map will be dissoced after the first macroexpansion if it's not actually interned
- to work around this, the function responsible for updating t.a's namespace map is pluggable, thrugh a function under the
:update-ns-map! key in t.a.jvm's global-env, so that you can provide your own that ensures the non interned var is kept around
understanding all this requires some knowledge of how clojure's evaluation model works and some understanding of tools.analyzer's implementation
all this complexity is unfortunately unavoidable, since clojure's evaluation model wasn't designed with ease of analysis in mind
that would be handy, but usually the unquote / quote combo does the trick otherwise
(case x (1 2) :a :b)
(1 2) is fully simplified (one of the few places something that has parens inside it would be such)
(depending on how you’re doing this simplifying and whether the language you are supporting is actually clojure or not)
One last syntax quote context question of the day 😀.. I am trying to construct a map from a collection of forms
Map literal must contain an even number of forms
@lxsameer There is a #clojure-spec room. There are many ways to have specs referencing specs, such as:
(s/def ::checks (s/coll-of ::depend)) (`::depend` is a spec)