chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] SRFI-12 non-compliance


From: Reed Sheridan
Subject: [Chicken-users] SRFI-12 non-compliance
Date: Tue, 28 Feb 2006 00:33:36 -0600

>From SRFI-12 documentation for condition-property-accessor:

Given a composite condition created with MAKE-COMPOSITE-CONDITION, the procedure returns the value that is associated with prop-key in one of the components that satisfies (CONDITION-PREDICATE kind-key).


But Chicken returns the value associated with kind-key in any member of a composite condition:

(define foo (make-composite-condition (make-property-condition 'foo 'bar 1) (make-property-condition 'baz 'quux 3)))
;; Chicken returns 1.  Behavior is undefined in SRFI-12, but probably should return #f or raise error
((condition-property-accessor 'foo 'quux) foo)
                   

And worse, it may return that of the wrong member:

;;SRFI-12 would return 3, Chicken returns 1
(define bar (make-composite-condition (make-property-condition 'foo 'bar 1) (make-property-condition 'baz 'bar 3)))
((condition-property-accessor 'baz 'bar) bar)

A fix is fairly easy, but I don't know how deeply assumptions about the current implementation run...

Reed Sheridan


reply via email to

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