From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: Re: r6rs define-record-type is unhygienic Date: Fri, 17 Jun 2011 10:34:35 +0200 Message-ID: <877h8kamas.fsf@pobox.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1308326122 15497 80.91.229.12 (17 Jun 2011 15:55:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2011 15:55:22 +0000 (UTC) Cc: bug-guile@gnu.org To: Ian Price Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jun 17 17:55:18 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QXbO5-0000U1-Pu for guile-bugs@m.gmane.org; Fri, 17 Jun 2011 17:55:13 +0200 Original-Received: from localhost ([::1]:50082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXbO4-0007zH-UZ for guile-bugs@m.gmane.org; Fri, 17 Jun 2011 11:55:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXafV-0002xF-Eu for bug-guile@gnu.org; Fri, 17 Jun 2011 11:09:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXafR-0008No-9p for bug-guile@gnu.org; Fri, 17 Jun 2011 11:09:08 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:57263 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXafQ-0008KY-UR for bug-guile@gnu.org; Fri, 17 Jun 2011 11:09:05 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id F1DD65F3D; Fri, 17 Jun 2011 11:10:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ycIRhrVe4eZS5+u3ZOImoMS1xRE=; b=c6KWW5 BySgQKV2jx48PtSh/t7YffjITF5WtoJCM7kVoh7CRebSKKdLuqJ6GrRpuvbdPRMM iqJExVFcX+QrXtWENP3rOiSDtsqCjhJce9eFwxZ7gpVpsULSRCSKnzBCFvIPy9Kf oNT9H+mT2bGL0UwBeEbCpzuiZNMe74Xa23ALU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=gK3WUzDlLlY4+CjiBIzeNQxLAr+Cx774 uTitrFL4cRwAfKYybSUMDk89kTi7IkMVbzz9YrAW5s99sESnQfZu7uyDNkAXTDpm sjN3L5ttju8B/8iocEOe8EFZ1WgwSag+W7I5VbT3OwBAxDiaBGRbuX5Rm3JDXtEM sgM89XssDos= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id EC44C5F3C; Fri, 17 Jun 2011 11:10:55 -0400 (EDT) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 1E26C5F3B; Fri, 17 Jun 2011 11:10:54 -0400 (EDT) In-Reply-To: (Ian Price's message of "Sat, 11 Jun 2011 14:36:16 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: FF8B6FFA-98F3-11E0-B169-5875C023C68D-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5648 Archived-At: Hi Ian, Great debugging, and great patch. On Sat 11 Jun 2011 15:36, Ian Price writes: > I have attached a patch for stable-2.0 to deal with these > issues. Keywords are now matched as syntax-case literals, and > sub-expressions are de-structured as necessary, rather than by using > syntax->datum on all the clauses at the start. There are some issues I > didn't touch, e.g. I think that the error messages should be improved, > but I can do that too if you would like. Please feel free to improve the error messages, or anything else really. Only a couple of nits with the patch: > * module/rnrs/records/syntactic.scm(define-record-type0, process-fields): ^ a space goes here > + (list (wrap `(immutable ,(syntax->datum #'name))) (guess-accessor-name #'name) #f)] Please avoid lines longer than 80 characters, if possible. > + (let loop ((_fields *unspecified*) > + (_parent *unspecified*) I realize this was in the original code, but better to use some other value to indicate a non-initialized value. In the future *unspecified* will be the same as (values). > :use-module ((rnrs records inspection) :version (6)) > + :use-module ((rnrs conditions) :version (6)) > + :use-module ((rnrs exceptions) :version (6)) > + :use-module ((system base compile) #:select (compile)) > :use-module (test-suite lib)) Along the same lines, #:use-module and #:version are the preferred spellings now. > +(with-test-prefix "record hygiene" Thanks for the test. Want to fix the line wrapping and the commit message and resubmit? Thanks! Andy -- http://wingolog.org/