1

I know (env) gives the full environment and (env :something) does a single lookup. Is there any way to query the contents of a profile? For instance, get a map of everything defined in the dev profile?

Chip
  • 75
  • 8
  • see http://stackoverflow.com/questions/16270805/how-to-get-the-version-of-the-current-clojure-project-in-the-repl and http://stackoverflow.com/questions/20469012/how-to-access-values-on-leiningen-profiles – Josh Mar 13 '17 at 17:54
  • Thanks — and I don't see how the answers to those questions apply. Neither show how to return a map of a given profile. Am I missing something? – Chip Mar 13 '17 at 18:59

1 Answers1

0

If I understand your querstion correctly this is one way of solving it:

user=> a
{:dev {:env {:database-url "jdbc:postgresql://localhost/dev"}},
:test {:env {:database-url "jdbc:postgresql://localhost/test"}}}
user=> (:dev a)
{:env {:database-url "jdbc:postgresql://localhost/dev"}}
user=> (:env (:dev a))
{:database-url "jdbc:postgresql://localhost/dev"}
Istvan
  • 7,500
  • 9
  • 59
  • 109