Fork me on GitHub
#beginners
<
2015-12-21
>
Tim01:12:46

(list 'proc '(q) (list '(* q 2)) atom-env) is there a way to express this without the list keyword, where atom-env is a variable?

Tim01:12:11

I’m trying variable combinations, with no luck

seancorfield01:12:04

You mean something like this:

(let [atom-env {:a 1}] `(proc (q) (* q 2) ~atom-env))

seancorfield01:12:29

That uses a backtick quote so you can escape values into it

seancorfield01:12:57

Be warned that proc etc will be expanded in the context of the current namespace which may not be what you want?

seancorfield01:12:07

(I'm not sure what you're trying to do)

seancorfield01:12:56

or maybe (let [atom-env {:a 1}] (concat '(proc (q) (* q 2)) [atom-env])) ?

seancorfield02:12:17

i.e., programmatically constructing the list

Tim02:12:47

okay, interesting. Thank you

trancehime04:12:56

Anyone around?

seancorfield06:12:52

Yeah, sort of (late to the convo but...)

firinne22:12:14

Hey, not sure if this is the best place to ask this, but I’m running into an issue where whenever I run lein uberjar to try and compile my app, it is trying to connect to datomic (but since I’m using a different host for datomic in production, it can’t reach that url while it is being compiled), should I just be using a (try … catch …) block for creating the db and connecting to it?

akiva22:12:34

It’s a configuration issue. I’ve simply ‘given up’ and just assign environment variables that can be read through environ (https://github.com/weavejester/environ). I know others prefer reading from profiles.clj or from some kind of configuration file but, eh, I’m fine with environment variables.