chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] idiomatic/usual way of file-based configuration in S


From: Mario Domenech Goulart
Subject: Re: [Chicken-users] idiomatic/usual way of file-based configuration in Scheme
Date: 06 Feb 2007 08:49:23 -0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Hello Thu,

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:
http://www.call-with-current-continuation.org/eggs/s11n.html

PS: I don't know what Java's properties files are, I considered the
second paragraph from your message.

Best wishes,
Mario





reply via email to

[Prev in Thread] Current Thread [Next in Thread]