Hello,

our implementation of (rnrs records syntactic) currently uses symbols
for record-name matching, which is not right approach.  Can be
demonstrated by the following:

--8<---------------cut here---------------start------------->8---
$ cat test.scm 
(define-module (foo)
  #:use-module (rnrs records syntactic))

(define-record-type a)
(define b a)

(pk a b (eq? a b))
(pk (record-type-descriptor b))
$ guile -s test.scm 

;;; (#<record-type a> #<record-type a> #t)

;;; (#f)
--8<---------------cut here---------------end--------------->8---

This really should output #t as the final line.  Record names should be
identifiers, like procedures and macros, not symbols as we have them.

Additionally, record-name should not be global, so the following should
not output the record type a, since it is not known inside the (bar)
module.

--8<---------------cut here---------------start------------->8---
$ cat test.scm 
(define-module (foo)
  #:use-module (rnrs records syntactic))

(define-record-type a)

(define-module (bar)
  #:use-module (rnrs records syntactic))

(pk (record-type-descriptor a))
$ guile -s test.scm 

;;; (#<record-type a>)
--8<---------------cut here---------------end--------------->8---

I think the fix should be to use the record-name itself as key in the
record-type-registry, instead of the current (quote record-name).

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.



Reply via email to