bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: record type not safely stored


From: Ludovic Courtès
Subject: Re: record type not safely stored
Date: Wed, 18 Feb 2009 17:56:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux)

Hi,

Judy Hawkins <address@hidden> writes:

> (define r:type (make-record-type "good-rec" '(laugh sleep)))

[...]

>  guile> (load "rb.scm")
>  Good record?
>  #t
>  #<good-rec laugh: giggle sleep: dream>
>
>  guile> (r:g:laugh Keep-r1)
>  "giggle"
>
>  guile> (load "rb.scm")
>  Keep-r1 already has the record
>  Good record?
>  #f
>  #<good-rec laugh: giggle sleep: dream>
>
>  guile> (r:g:laugh Keep-r1)
>
>  ERROR: In procedure %record-type-check:
>  ERROR: Wrong type record (want `"good-rec"'): #<good-rec laugh: giggle 
> sleep: dream>
>  ABORT: (wrong-type-arg)
>  guile> 
>
>  what I expected was for (r:g:laugh Keep-r1) to work fine both times.

That's because each load yields a `make-record-type', and the record
type created the second type has the same name as the one created the
first time but it's not `eq?' to it, hence the type mismatch.

Thanks,
Ludo'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]