[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] SRFI-9 vs. define-record vs. (copy)
From: |
tonyg |
Subject: |
[Chicken-users] SRFI-9 vs. define-record vs. (copy) |
Date: |
Tue, 12 Nov 2002 14:13:20 +0000 |
User-agent: |
Mutt/1.4i |
Currently SRFI-9 records and (define-record) records are
disjoint. Could they be made the same? I'd really love to have
(define-record-printer) for SRFI-9 records :-)
On the topic of records, the (copy) function is *too* deep - it copies
the record type as well as the record value!
(define-record x y)
(define a (make-x 1))
(define b (copy a))
a ==> #<x>
b ==> #<x> ;; but it's a *different* x
(x-y a) ==> 1
(x-y b) ==> error
(x? a) ==> #t
(x? b) ==> #f
Any suggestions on how this might be avoided?
Tony
--
>From the Son of Heaven down to the mass of the people, all must
consider the cultivation of the person the root of everything besides.
- Confucius, "The Great Learning"
- [Chicken-users] SRFI-9 vs. define-record vs. (copy),
tonyg <=