guile-devel
[Top][All Lists]
Advanced

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

Re: srfi-9 record type checking


From: Neil Jerram
Subject: Re: srfi-9 record type checking
Date: Tue, 13 Jun 2006 00:00:50 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Neil Jerram <address@hidden> writes:
>
>> I vote for just fixing record-accessor to be strict by default;
>> i.e. treating current behaviour as a bug.  I'd be surprised if anyone
>> was relying on this, and if they are it's easy to code a workaround.
>
> The issue is that this would impact people that use records directly
> (i.e., not via SRFI-9) and although this `#f' behavior is undocumented,
> they may well have come to rely on it.

Yes, that is indeed the issue.  I just think that (i) your "may" is
extremely unlikely, and/because (ii) the current behaviour is
sufficiently odd that we can see it as a bug - for which there is
obviously no back-compatibility requirement - instead of as
"behaviour", and (iii) the nature of 'record-accessor' is such that it
can be fixed up in just one place if someone really does want the old
behaviour:

(define new-record-accessor record-accessor)

(set! record-accessor
  (lambda (type field)
    (lambda (obj)
      (and ((record-predicate type) obj)
           ((new-record-accessor type field) obj)))))

So on balance I don't think we need to provide complete compatibility
within Guile here.

Regards,
     Neil





reply via email to

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