unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* The r6rs record-type in pattern matching of Guile-3.0
@ 2020-08-24 20:16 Nala Ginrut
  2020-09-15 12:15 ` Nala Ginrut
  0 siblings, 1 reply; 2+ messages in thread
From: Nala Ginrut @ 2020-08-24 20:16 UTC (permalink / raw)
  To: guile-devel; +Cc: Andy Wingo

[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]

Hi folks!
I found the r6rs record pattern matching has different results compared to
Guile-2.
Here is the example code:

-----------------------------------------code--------------------------------------
,use (rnrs)
,use (ice-9 match)

(define-record-type aaa (fields a))
(define-record-type bbb (parent aaa) (fields b))
(define r (make-bbb 1 2))

(match r
  (($ bbb ($ aaa _ a) b) (list a b))
  (else "no"))
;; ==> "no"  in Guile-3
;; ===> (1 2) in Guile-2

(match r
  (($ bbb a b) (list a b))
  (else "no"))
==> (1 2)  in Guile-3
==> (<aaa> 2) in Guile-2
--------------------------------------------end----------------------------------------------

In Guile-2, we have to specify the parent record-type for binding the
fields of the parent, but it seems not in Guile-3.0.
I know Guile-3 had tweaked record-type to unify the low-level
implementation.

My question: Is this the new expected activity? Do we have to tweak all
record type matching since Guile-3 ?
Or maybe it's just a bug?

Best regards.

[-- Attachment #2: Type: text/html, Size: 1437 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-15 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 20:16 The r6rs record-type in pattern matching of Guile-3.0 Nala Ginrut
2020-09-15 12:15 ` Nala Ginrut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).