+ 1 for literal using literal Clojure data structures for configuration. On Wed, Mar 25, 2009 at 5:50 PM, Laurent PETIT <laurent.pe...@gmail.com> wrote: > And why not just use clojure source code literal datastructures as the > persistence format ? > > With the pretty print function released by Tom Faulhaber, it's even possible > to painlessly write configuration back while keeping it clear (though not > currently possible to maintain things such as comments, I fear), > > -- > Laurent > > 2009/3/25 Korny Sietsma <ko...@sietsma.com> >> >> ooh - that's precisely why I was looking into duck-streams myself; thanks >> for that! >> >> Mind you, after a while in the Ruby world, I'd highly recommend looking at >> YAML for config files - it's human readable and fairly easily writeable, and >> lets you add arrays, nested structures, etc. fairly easily. >> For simple config, and for Java friendliness, I can also see the value of >> properties files - I just keep working on java projects that have 200 line >> property files with hacks to handle nested structures and lists - it gets >> ugly real soon! >> >> - Korny >> >> On Thu, Mar 26, 2009 at 5:57 AM, Rayne <disciplera...@gmail.com> wrote: >>> >>> I wrote a simple, small configuration file parser and reader that uses >>> the duck-streams library. You might find some of the examples >>> interesting. >>> >>> http://paste.pocoo.org/show/109498/ >>> >>> On Mar 24, 11:20 am, e <evier...@gmail.com> wrote: >>> > is there something as simple as this in clojure? >>> > >>> > whole python program: >>> > >>> > of = open(filename,"w") >>> > of.write("hello") >>> > of.close() >>> > >>> > I checked the api and looked around the wiki and google quickly and saw >>> > how >>> > to use java's stuff to do it ... but, welll... >>> > >>> > I noticed "slurp" in the api for reading ... but only the whole file at >>> > once >>> > (read() but no readline()). Is there something symmetrical for writing >>> > (outputting)? Is there a web page called "File IO" somewhere? >>> > >>> > Thanks. >>> >> >> >> >> -- >> Kornelis Sietsma korny at my surname dot com >> "Every jumbled pile of person has a thinking part >> that wonders what the part that isn't thinking >> isn't thinking of" >> >> > > > > > >
--~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---