From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: srfi-9 record type checking Date: Wed, 07 Jun 2006 09:19:15 +1000 Message-ID: <873behlvnw.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1149636009 8188 80.91.229.2 (6 Jun 2006 23:20:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Jun 2006 23:20:09 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jun 07 01:20:07 2006 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FnkqE-00045A-EA for guile-devel@m.gmane.org; Wed, 07 Jun 2006 01:20:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FnkqD-00062Q-Ts for guile-devel@m.gmane.org; Tue, 06 Jun 2006 19:20:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FnkqA-00062L-Vo for guile-devel@gnu.org; Tue, 06 Jun 2006 19:20:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fnkq9-000628-W4 for guile-devel@gnu.org; Tue, 06 Jun 2006 19:20:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fnkq9-000625-TF for guile-devel@gnu.org; Tue, 06 Jun 2006 19:20:01 -0400 Original-Received: from [61.8.0.115] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fnkxc-0004oh-U3 for guile-devel@gnu.org; Tue, 06 Jun 2006 19:27:45 -0400 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout2.pacific.net.au (Postfix) with ESMTP id E4AF36FCAA for ; Wed, 7 Jun 2006 09:19:57 +1000 (EST) Original-Received: from localhost (ppp2006.dyn.pacific.net.au [61.8.32.6]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k56NJue3022306 for ; Wed, 7 Jun 2006 09:19:57 +1000 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1FnkpQ-0001yj-00; Wed, 07 Jun 2006 09:19:16 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:5964 Archived-At: Speaking of srfi-9 records (Ludovic on guile-user), I notice the spec calls for an accessor used on a wrong type record to be an error but currently guile returns #f for that. Eg. (use-modules (srfi srfi-9)) (define-record-type foo (make-foo f1 f2) foo? (f1 get-f1 set-f1) (f2 get-f2 set-f2)) (define-record-type bar (make-bar b1 b2) bar? (b1 get-b1 set-b1) (b2 get-b2 set-b2)) (define f (make-foo 1 2)) (pk (get-b1 f)) 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? _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel