From: Neil Jerram <neil@ossau.uklinux.net>
Subject: Re: srfi-9 record type checking
Date: Wed, 07 Jun 2006 23:18:21 +0100 [thread overview]
Message-ID: <87pshkfw42.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87k67sudbj.fsf@laas.fr> ( Ludovic Courtès's message of "Wed, 07 Jun 2006 18:42:56 +0200")
ludovic.courtes@laas.fr (Ludovic Courtès) writes:
> Kevin Ryde <user42@zip.com.au> 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'?
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.
Regards,
Neil
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2006-06-07 22:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-06 23:19 srfi-9 record type checking Kevin Ryde
2006-06-07 16:42 ` Ludovic Courtès
2006-06-07 22:18 ` Neil Jerram [this message]
2006-06-07 23:21 ` Kevin Ryde
2006-06-08 7:14 ` Ludovic Courtès
2006-06-12 23:00 ` Neil Jerram
2006-06-13 7:26 ` Ludovic Courtès
2006-08-02 0:42 ` Kevin Ryde
2006-08-22 9:37 ` Ludovic Courtès
2006-08-25 1:04 ` Kevin Ryde
2006-06-07 23:31 ` Kevin Ryde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pshkfw42.fsf@ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).