Yes, I think we can all agree on that. My point about editability/readability was specifically w/rt YAML vs JSON, but my argument for YAML vs reader is all about the decoupling of config from language specifics to make it so that not everyone who edits config needs to know what a REPL is. ;)
On Mon, Jun 25, 2012 at 12:22 PM, Softaddicts <lprefonta...@softaddicts.ca>wrote: > I think of Clojure configuration expressions as being human > editable/readable, testable in a few seconds (cut&paste in the REPL) and > concise, > However, I do agree that anything is better than XML :) > > Bad choice of words maybe ? > > Luc > It's a holiday here I have some time to tease you a bit :) > > > > Hi Jay, > > > Thanks! As far as JSON vs YAML, I think of these as generally > human-edited > > configuration files, and I don't think it is controversial to claim that > > YAML is much better suited to human editing than JSON or XML. As far as > > using the Clojure/Clojurescript reader instead of YAML, the way I see it > is > > that it's just a choice between whether "everything is in Clojure" > matters > > more, or whether making config files more readily manipulable by > > non-Clojure devs and non-devs is more the goal (say for example for an > > operations team working with a polyglot deployment). > > > That said, if there is interest in also supporting config files using > > native reader syntax it would be an easy addition to make, and wouldn't > > affect any other functionality. You would simply expose the internal > > representation, which is just nested hash-maps e.g. {:dev {:some-config > > {:something "foo"} :other "bar"} :test {...}} and have a function to load > > clj files in in that format directly. When loading in files with the > > reader, it would probably be a good idea to bind the dynamic var that > > disables the #=() reader macro. > > > Actually, a better idea might be to enable passing the config data as > > Clojure data as an optional alternative to specifying a YAML file. The > > motivation would be to make it possible to load from any file format you > > choose in your own code and pass it in the data (so long as it can be > made > > into a nested hash-map). > > > However I do think it makes sense for YAML file to remain the default > way > > of loading data in any scenario, for reasons stated above. > > > On Sun, Jun 24, 2012 at 10:12 AM, Jay Fields <j...@jayfields.com> > wrote: > > > > Hi Robert, > > > > > > Everything looks good, thanks for sharing the library. A philosophical > > > question, why YAML and not JSON or raw clj? > > > > > > Cheers, Jay > > > > > > On Jun 22, 2012, at 7:30 PM, Robert Levy wrote: > > > > > > It is my pleasure to announce the 0.5.0 release of milieu, a library > for > > > environment-based application configuration that I have developed and > > > actively maintain at Draker <http://www.drakerenergy.com/> in > Burlington, > > > Vermont. Having made use of it in our day-to-day work for several > months > > > now, we have found this library to be very useful for managing > > > configuration in our proprietary time-series data acquisition back-end > > > systems (also all written in Clojure of course). I think this library > will > > > add value to applications in any domain. > > > > > > The source can be found at https://github.com/drakerlabs/milieu and > the > > > leiningen / maven dependency information is at > http://clojars.org/milieu. > > > Issues/feedback and pull requests are of course welcome! > > > > > > milieu > > > > > > The environmentally friendly configuration tool. > > > ------------------------------ > > > > > > *Build status:* [image: Build Status]< > http://travis-ci.org/drakerlabs/milieu> > > > <https://github.com/drakerlabs/milieu#features>Features: > > > > > > - > > > > > > Set up environment-specific configuration for your Clojure > > > application, using the popular YAML file format. > > > - > > > > > > Access config values: > > > > > > Specifying config values: > > > > > > (config/value :my :config :value) > > > > > > This will access the value in > > > > > > dev|test|...:my: > > > config: > > > value: > > > > > > Specifying config values as optional: > > > > > > (config/value| :my :config :value) ; same as config/value except > doesn’t warn if it’s not found(config/value| [:my :config :value] > "alternate value") ; provide alternate value > > > > > > - > > > > > > Optionally auto-load config file. > > > - using the default filename of "configure.yml" enables autoload > > > - any other config file name can be specified by calling > load-config > > > - > > > > > > Bind the environment within a calling context using with-env. > > > > > > (config/with-env env > > > (when (config/value :some :setting) ... )) > > > > > > - > > > > > > Specify the default environment using the MILIEU_ENV system > variable. > > > - > > > > > > Override environment-specific settings using arguments to your > > > command-line application. > > > > > > (config/commandline-overrides! args) > > > (config/with-env env > > > ... ) > > > > > > - > > > > > > In cases where the environment can be variable, code evaluation can > by > > > restricted in with-env or only-env, or more generally conditional > using > > > if-env and when-env. > > > > > > ;; If env is prod, the code in the body will not be exercised,;; an > exception is thrown instead:(defn -main [env & args] > > > (config/with-env [env :only [:test :dev]] ,,,)) > > > > > > Alternatively (for example if you aren't in the context of a > > > with-env)... > > > > > > ;; If env is prod, the code in the body will not be exercised,;; an > exception is thrown instead:(config/only-env [:test :dev] ,,,) > > > > > > The following forms are general purpose conditionals (not assertions > > > of environment restrictions). > > > > > > (config/if-env :test "hello" "goodbye") > > > > > > (config/when-env :dev ,,,) > > > > > > > > > Helpful info / warnings that can be turned off with MILIEU_QUIET system > > > variable: > > > > > > - > > > > > > WARNING: system variable MILIEU_ENV was not set. Default value will > be > > > "dev" > > > - > > > > > > WARNING: requested config setting [:fou :barre] not found! > > > - > > > > > > INFO: to enable auto-load, name your config-file configure.yml. > > > > > > <https://github.com/drakerlabs/milieu#use>Use < > https://github.com/drakerlabs/milieu#installation> > > > Installation > > > > > > http://clojars.org/milieu > > > <https://github.com/drakerlabs/milieu#getting-started>Getting Started > > > > > > (ns example.core > > > (:require [milieu.config :as config])) > > > > > > <https://github.com/drakerlabs/milieu#example>Example > > > > > > (defn -main [env & args] > > > (config/commandline-overrides! args) > > > (config/with-env env > > > (when (config/value| :some :setting) ,,, > > > > > > <https://github.com/drakerlabs/milieu#command-line-override > >Command-line > > > Override > > > > > > $ myprogram prod --fou.barre Fred --some.setting 127.0.0.1 > > > > > > <https://github.com/drakerlabs/milieu#license>License > > > > > > Author: Robert Levy / @rplevy-draker > > > > > > Acknowledgments: @alanpeabody, @S11001001, @AlexBaranosky > > > > > > Copyright © 2012 Draker Labs > > > > > > Distributed under the Eclipse Public License, the same as Clojure. > > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Clojure" group. > > > To post to this group, send email to clojure@googlegroups.com > > > Note that posts from new members are moderated - please be patient with > > > your first post. > > > To unsubscribe from this group, send email to > > > clojure+unsubscr...@googlegroups.com > > > For more options, visit this group at > > > http://groups.google.com/group/clojure?hl=en > > > > > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Clojure" group. > > > To post to this group, send email to clojure@googlegroups.com > > > Note that posts from new members are moderated - please be patient with > > > your first post. > > > To unsubscribe from this group, send email to > > > clojure+unsubscr...@googlegroups.com > > > For more options, visit this group at > > > http://groups.google.com/group/clojure?hl=en > > > -- > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clojure@googlegroups.com > > Note that posts from new members are moderated - please be patient with > your first post. > > To unsubscribe from this group, send email to > > clojure+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/clojure?hl=en > -- > Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad! > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en