Hi Ryo Thanks for releasing this. I've started using it for a configuration file that was previously an edn file. I was mainly interested in the import and include features but have now started using the eval macro to replace some repetitive parts of the file with for loops. I'll admit that using eval and embedding clojure in the config file feels like a slippery slope. I'm worried I'll quickly make understanding clojure a prerequisite for editing the config file. I'm not sure if the answer is to add a few more macros for common things like looping, or if I just need to be diligent and use eval sparingly or not at all. It seems easy to remove features in baum to enforce keeping the file simple, but I haven't taken that step yet.
The import/include feature alone is useful though. I did hit two problems with my use-case though. First, I wanted relative include paths to be resolved relative to the path of the file being parsed. I hacked around this in a messy way, but do you think it would make sense to either add a :relative-to-path or a :file-resolve-fn to opts to customize how relative paths are resolved? The :file-resolve-fn value would be a function called with the opts and the included file's path and returns the absolute path or any object slurp accepts. I haven't thought through how nested relative includes would work. Second, I wanted to customize how the contents of the included map was merged. For example, when both maps contained a key whose values are vectors I wanted to concatenate the vectors. I implemented this as my own reducer, but the other way would be to add a key to opts for controlling the merge behaviour of include/import/override. I don't know if this is a common enough requirement to warrant that though. thanks again! Geoff On Saturday, 4 April 2015 05:59:27 UTC-4, Ryo Fukumuro wrote: > > Hi all, > > I'd like to announce the release of Baum. > > https://github.com/rkworks/baum > > Baum, my first public library for Clojure, is designed to create > "self-contained" configuration files. > > It allows you to include the following things in your configuration files: > > - References to external files > - References to environment variables with a fallback value > - Conditional loading of a part of config tree > - `let` > - etc > > And it is very easy to extend the DSL to add new features. > For more details, please see README. > > Any suggestions are welcome. > > Best, > Ryo > -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.