[CM] Unexpected behavior of record types in lists

Rudolf Adamkovič salutis at me.com
Tue May 17 00:04:07 PDT 2022


Hello smart people!

I found the following unexpected behavior of record types in lists:

(define-record-type <proxy>
  (make-proxy type)
  proxy?
  (type proxy-type))

(let ((proxies (list (make-proxy 'one)
                     (make-proxy 'two))))

  ;; EXPECTED: "one", ACTUAL: <proxy>
  (display (proxy-type (list-ref proxies 0)))

  ;; EXPECTED: "two", ACTUAL: "two" (OK)
  (display (proxy-type (list-ref proxies 1))))

It makes our R7RS program fail tests on s7 (but not Guile).

Rudy
-- 
"Be especially critical of any statement following the word
'obviously.'"
-- Anna Pell Wheeler, 1883-1966

Rudolf Adamkovič <salutis at me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



More information about the Cmdist mailing list