From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Improved source properties and errors; => within case Date: Wed, 08 Feb 2012 11:06:08 +0100 Message-ID: <87fwel1vxr.fsf@pobox.com> References: <87haz18zet.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1328695590 23206 80.91.229.3 (8 Feb 2012 10:06:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Feb 2012 10:06:30 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Feb 08 11:06:29 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rv4Q0-0005QY-A2 for guile-devel@m.gmane.org; Wed, 08 Feb 2012 11:06:28 +0100 Original-Received: from localhost ([::1]:58999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv4Pz-0007g9-QF for guile-devel@m.gmane.org; Wed, 08 Feb 2012 05:06:27 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv4Pt-0007fa-2t for guile-devel@gnu.org; Wed, 08 Feb 2012 05:06:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rv4Pm-00064b-59 for guile-devel@gnu.org; Wed, 08 Feb 2012 05:06:21 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:64722 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv4Pl-00064W-UI for guile-devel@gnu.org; Wed, 08 Feb 2012 05:06:14 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 282857C47; Wed, 8 Feb 2012 05:06:13 -0500 (EST) 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=IhfUDqO+j5C59gIf1eInNNw9Fxg=; b=YxmA6X 2orsKqDQO09ane7TEzv29B5jd+8pPWnQS+youEKjR7AT2HG9p0rNnmZC50YzKEmi tr2IUF+iXXayFEtm7jvLPJmT5q37BMxqVFcacv1hsniT4G5xQGxPGTGrt7qkkRF9 9qzae0QVxgRAXQIa+KaEfa1q8On/S5APM/Rd0= 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=hKnU8fcNWJ8a3U2jPCFjdKOxFDHlLYDU JkZ5QGJe30HVXJJtMaXTUXSblcQkOqdJdmhIU7ey7ZOFVf7g2NVPXrKw6BjIna0F u/+eoewcj+G0Rp1aAzWObI8Ao4RoamRW77Z2PUDYvVBx5BpdjjtmTnjFXgDBuQX3 WGrIp2A63Ug= 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 1DB8C7C46; Wed, 8 Feb 2012 05:06:13 -0500 (EST) Original-Received: from badger (unknown [90.163.28.157]) (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 511A47C45; Wed, 8 Feb 2012 05:06:12 -0500 (EST) In-Reply-To: <87haz18zet.fsf@netris.org> (Mark H. Weaver's message of "Wed, 08 Feb 2012 04:09:14 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: 879FB098-523C-11E1-B04B-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13823 Archived-At: Heya Mark, Patch set looks good to me. Please push. One comment: On Wed 08 Feb 2012 10:09, Mark H Weaver writes: > The way that source properties are stored means that Guile can only > -associate source properties with parenthesized expressions, and not, for > -example, with individual symbols, numbers or strings. The difference > -can be seen by typing @code{(xxx)} and @code{xxx} at the Guile prompt > -(where the variable @code{xxx} has not been defined): > +associate source properties with parenthesized expressions and non-empty > +strings, and not, for example, with individual symbols or numbers. The > +difference can be seen by typing @code{(xxx)} and @code{xxx} at the > +Guile prompt (where the variable @code{xxx} has not been defined): This isn't quite right; #*101010101 should probably get source info, no? And is it useful to have an exception for empty strings? I would think that it would be fine to return fresh empty strings. The compiler would DTRT. I don't care much though. Perhaps: "Everything but numbers, symbols, characters, and booleans get source information." Dunno. > + (syntax-case whole-expr () > + ((_ clause clauses ...) > + #`(begin (This is in `cond'). Why is the begin needed here? > + #`((let ((t test)) > + (if t t #,@tail))))) Use `or' here. > + (syntax-case whole-expr () > + ((_ expr clause clauses ...) > + (with-syntax ((key #'key)) > + #`(let ((key expr)) > + #,@(fold (In `case'.) Likewise here, it would be good to avoid this use of an implicit `begin', of possible. > + (if (memv datum seen) > + (warn-datum 'duplicate-case-datum)) > + (if (or (pair? datum) > + (array? datum) > + (generalized-vector? datum)) > + (warn-datum 'bad-case-datum)) Nice. Cheers, Andy -- http://wingolog.org/