[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] SRFI-57 does not seem to respect type
From: |
Zbigniew Szadkowski |
Subject: |
[Chicken-users] SRFI-57 does not seem to respect type |
Date: |
Thu, 14 Apr 2005 23:13:03 -0500 |
Hello,
Either I am not understanding SRFI-57, or I have found a bug.
Consider the following:
(use srfi-57)
; loading /usr/local/lib/chicken/srfi-57.scm ...
; loading library srfi-1 ...
; loading /usr/local/lib/chicken/srfi-57-support.so ...
(import records)
(define-record-type foo (make-foo x) foo? (x get-foo-x))
(define-record-type bar (make-bar x) bar? (x get-bar-x))
(define-record-type baz (make-baz x y) baz? (x get-baz-x) (y get-baz-y))
(get-foo-x (make-bar 3))
==> 3
(get-bar-x (make-foo-3))
==> 3
(equal? (make-foo 3) (make-bar 3))
==> #t
(get-baz-y (make-bar 3))
==> Error: out of range
As far as I am concerned, none of these should succeed because the
types are incompatible. When performed with straight SRFI-9, you get
"Error: bad argument type - not a structure of the required type", and
#f for the equal?.
[Also, in SRFI-57 the types show up as #<record> instead of #<foo> or
#<bar>, but I am assuming this is a known limitation.]
Any thoughts?
Zb
- [Chicken-users] SRFI-57 does not seem to respect type,
Zbigniew Szadkowski <=