[Top][All Lists]

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

Re: srfi-9 record type checking

From: Ludovic Courtès
Subject: Re: srfi-9 record type checking
Date: Wed, 07 Jun 2006 18:42:56 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)


Kevin Ryde <address@hidden> writes:

> I guess `define-record-type' should be making a stricter procedure
> than `record-accessor' gives.
> I got bitten by this using `record-accessor' the other day.  For some
> reason I thought it had strict type checking and scratched my head for
> a while until realizing I was passing a wrong record and getting back
> #f.  Is that #f a feature?  Would there be scope to add an option to
> ask for a strict checking version?  Or make that the default?

I don't think we can add an optional argument to `record-accessor' while
preserving the current behavior by default.  That optional argument
would have to be more than just a default value: typically it would have
to be a wrong-type-arg handling procedure, and this would add too much
overhead IMO (OTOH, one may argue that we shouldn't worry too much about
overhead in error conditions).

Instead, we could perhaps add `record-type-strict-accessor'?


reply via email to

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