chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Parsing lists from external scheme intepreters


From: felix
Subject: Re: [Chicken-users] Parsing lists from external scheme intepreters
Date: Wed, 29 Sep 2004 22:45:32 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

Michael Erdmann wrote:

Now the complicated part starts. FramerD was providing the concept
of choices in order to represent the contents of result sets.
The nice thing about it was the following trick:

(define x (choice 1 2 3 4 5) )

(define (inc y)  (+ y 1))

(inc x) -> (choice 2 3 4 5 6)

which means the operation inc was executed on any member in the
choice. I have not seen this by now in the chicken documentation.
Does some thing similar exisit some where?

No, chicken doesn't support anything like that (and no other Scheme
system I know, AFAIK). Depending on how desperately you need that,
once could hack around with error-handlers, etc. But I don't
recommend that, unless you *really* need it.


I guess i can represent a choice as a list of elements where
the list is somehow marked as a choice.

Or try records, like SRFI-9 (`define-record-type'). That makes
your choice object distinct from other data.


cheers,
felix




reply via email to

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