|
From: | Michael Erdmann |
Subject: | Re: [Chicken-users] Parsing lists from external scheme intepreters |
Date: | Thu, 30 Sep 2004 08:09:27 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616 |
felix wrote:
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.
Thanks, but i will try to do a WoA. Choices are realy nice but they are also very in secure, e.g: (write "Hallo") ... (print-hallo names) (write "Done.") What happens, that print-hallo is never called if names is empty. The result is a completly different trace fingerprint which does not contain the print-hallo procedure at all. This is very confusing.
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
[Prev in Thread] | Current Thread | [Next in Thread] |