[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] idiomatic/usual way of file-based configuration in S
Re: [Chicken-users] idiomatic/usual way of file-based configuration in Scheme
Tue, 6 Feb 2007 10:16:57 -0800
On Feb 6, 2007, at 2:49 AM, Mario Domenech Goulart wrote:
On Tue, 6 Feb 2007 10:52:36 +0100 "minh thu" <address@hidden> wrote:
I was wondering if there was something like Java's properties files
that is commonly used in Scheme. (The reference to Java is because I
learned it, not because I like it :)
It would just amount to read a list of key/value pairs in Scheme
syntax. Or maybe a triple if the type is given.
What do you use ?
A simple approach would be dumping the representation of scheme
objects (e.g., lists) to a file:
csi> (define my-list '((1 2 3) (4 5 6) ("a" "b" "c")))
csi> (with-output-to-file "my-file" (lambda () (pp my-list)))
csi> (with-input-from-file "my-file" read)
((1 2 3) (4 5 6) ("a" "b" "c"))
There is also the s11n egg:
PS: I don't know what Java's properties files are, I considered the
second paragraph from your message.
Take a look at the SRFI-29 egg.
Chicken-users mailing list