Fork me on GitHub
Michael Stokley00:08:16

anyone know how to pass an env to resolve?

Michael Stokley00:08:27

i'm having trouble finding documentation about what a clojure env is

Michael Stokley00:08:25

"clojure env environment" is a particularly difficult google search 🙂


@michael740 It looks like it is just a map. Check out (source resolve) and (source ns-resolve)

Michael Stokley00:08:07

I don't think it's a map, since you can't pass a map to contains?

Michael Stokley00:08:24

it's a collection.

Michael Stokley00:08:17

oh, nvm... (contains? '{k v} 'k) works just fine


&env is one of the 'special variables' available to macros:


=> (defmacro foo [] (prn &env))
=> (foo)
=> (let [a 2] (foo))
{a #object[clojure.lang.Compiler$LocalBinding 0x41fdf8ca "clojure.lang.Compiler$LocalBinding@41fdf8ca"]}


(defn ^String return-string [] (str "hello, world!")) The ^String is a type hint for function return value of a metadata for function var?


@stardiviner Yeah, but in ClojureScript that would be (defn ^string return-string [] ...) while in Clojure it would be (defn return-string ^String [] ....)


(Normally you wouldn’t hint in ClojureScript. The one case where it is even remotely common to put type hints on function return types in ClojureScript is for predicates, in order to avoid checked ifs (see


And the need to add function return type hints will be reduced further in the next release of ClojureScript where the return type is inferred.


hey a question I have I just tried to make multiarity function like (defn myfun [number] (myfun number []) [number list] (...)) But obviously I can't do it as second version is not defined when first is trying to use Essentially I want to get function with 1 or 2 params, and if it is invoked with 1 param, then it is realized as calling itself with 1st param and default 2nd param... Or in other words, how do I supply "default" for params if they are not provided by call?


(defn myfun ([n] (myfun n [])) ([n l] ...))


ahh syntax... yea thanks


Hello Clojurians, I’ve read a few articles about Yada, also received a guidance and recommendations by Ray, but somehow I’m unable to follow Yada’s the manual. Details: 1 - cloned edge and ran boot dev (inside edge dir) and I receive the following error:

giga@ubuntu:~/edge/app$ boot dev
java.util.concurrent.ThreadPoolExecutor$  624
 java.util.concurrent.ThreadPoolExecutor.runWorker 1149
               clojure.core/binding-conveyor-fn/fn                 core.clj: 2022
                                 boot.core/boot/fn                 core.clj: 1032
                         boot.core/construct-tasks                 core.clj:  986
java.lang.IllegalArgumentException: No such task (dev)
        clojure.lang.ExceptionInfo: No such task (dev)
    line: 3
2 -
#Sun Aug 19 02:23:39 PDT 2018
Tried on mac then then on Ubuntu in VM, result is all the same.

Chris O’Donnell13:08:06

@chokheli looks to me like edge is using deps.edn now. See the readme at Perhaps that is the problem?


Yeah, I received assistance by JUXT guys, I was following the manual which provides boot instructions.


But one thing that baffles me is why take away “instant reload on each save?” and implement explicit command to enter - (reset)


Guys do you use any lib for validating http post requests? I've created my own right now but would be good to see some other code to get some inspiration

Michael Stokley20:08:10

is there a way to define a symbol in clojure such that it's re-evaluated each time it's invoked or named?

Michael Stokley20:08:03

for example, this is evaluated just once (def my-random-number (rand-nth (range 10)))

Michael Stokley20:08:08

alternatively, i could wrap in a fn


that's how it's actually done

Michael Stokley20:08:42

(def my-random-number #(rand-nth (range 10)))?


yeah, though for that specific example #(rand-int 10) does the same thing

Michael Stokley20:08:33

sweet, thank you sir


wow… @ryan.russell011 I came here to post the exact same thing


kind of confusing at the moment.


I am trying to find out if anything changed in the postgresql or jdbc library that might be causing the error


yeah.. I've been looking for that as well


so I changed the dependency in project.clj to [org.postgresql/postgresql "42.2.4"]... and it doesn't throw errors anymore. I haven't tested to see if it works.. but at least the repl didn't throw up on me.


I was trying something different…


I used a library to perforl the dsl and tried to run that code (I already had played with dsl and worked just fine…) but the error showed up again


@ryan.russell011 it worked just fine with this new version. Cheers!


yeah... I think the driver in the video is old. There is a note on the Maven site saying things have been moved. I clicked on that, then on the newest driver in that list... which has a lein tab as well...

👍 4