[r6rs-discuss] [Formal] Simplifying conditions

From: Michael Sperber <sperber>
Date: Mon Nov 27 01:45:07 2006

AndrevanTonder <andre_at_het.brown.edu> writes:

> On Sun, 26 Nov 2006, Michael Sperber wrote:
>
>> So how does this suggestion look to you?
>>
>> The condition system distinguishes between simple conditions and
>> compound conditions. A compound condition consists of an ordered set
>> of simple conditions. Thus, every condition can be viewed as an
>> ordered set of simple component conditions: If it is simple, the set
>> consists of the condition itself;
>
> - The last sentence may be read to imply that every simple condition is a
> compound condition. It is not clear to me if this is true or not.

It's not clear to me either :-) There are no predicates or anything to
distinguish, so it's mainly a matter of presentation. What's important
is that not every compound condition is a simple condition. The only
predicate you could define would be:

(define (simple-condition? c)
  (let ((components (condition->list c)))
    (and (pair? components)
         (null? (cdr components)))))

> - Conversely, are singleton compound conditions simple conditions?
> It seems to me that it would be simplest ;-) if they were indeed simple.
> For example, does the one-argument case of
>
> (make-compound-condition simple-condition)
>
> return a simple condition?

By the above predicate, yes.

> - Also, why not allow the degenerate case of null compound conditions?
> In other words, is there a deeper reason why the following should be
> illegal?
>
> (make-compound-condition)

No, and I don't think it is illegal.

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla
Received on Mon Nov 27 2006 - 01:45:01 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC