Open hyln9 opened 10 years ago
On Sep 11, 2009, at 4:06 PM, Juergen Haase wrote:
Public bug reported:
Using record-rtd on an opaque record gives the following exception message:
juergen@Nix:~$ ikarus Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1854, build
2009-09-08) Copyright (c) 2006-2009 Abdulaziz Ghuloum(define-record-type foo (opaque #t)) (define bar (make-foo)) (record-rtd bar) Unhandled exception Condition components:
- &assertion
- &who: record-rtd
- &message: "record is opaque"
- &irritants: ()
Yes, but messages are informational for you only: they cannot be used
reliably to deduce semantics. Consider that I might change the
message tomorrow to make it something else, like "record rtd is
inaccessible" or "Rekord ist undurchsichtig" or "εγγραφή
νεκρός", right? Consider that you (or someone else) might be
running your code under a different implementation. In any way, you
cannot rely on this as a source of information, so, changing it does
not add or subtract anything. [also, the message "not a record" is
technically false since it is a record, the record system knows it
is a record, and it's just lying. "record is opaque" is technically
the correct message for both errors.]
(record? is also a liar as per R6RS's specification: it should've been
called nonopaque-record? or transparent-record? or something like it.)
Aziz,,,
Launchpad Details: #LPC Abdulaziz Ghuloum - 2009-09-12 15:52:12 -0400
Using record-rtd on an opaque record gives the following exception message:
juergen@Nix:~$ ikarus Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1854, build 2009-09-08) Copyright (c) 2006-2009 Abdulaziz Ghuloum
By intercepting this exception it's possible to create a new record predicate:
I think it shouldn't be possible to do this. It should instead raise the same exception as for non-record objects:
Launchpad Details: #LP427859 Juergen Haase - 2009-09-11 09:06:32 -0400