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] Allow printing of malformed tree-il Date: Thu, 08 Jul 2010 11:16:45 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1278587557 6260 80.91.229.12 (8 Jul 2010 11:12:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 8 Jul 2010 11:12:37 +0000 (UTC) Cc: guile-devel To: No Itisnt Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jul 08 13:12:35 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OWp1u-0005WE-Hl for guile-devel@m.gmane.org; Thu, 08 Jul 2010 13:12:34 +0200 Original-Received: from localhost ([127.0.0.1]:40220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWp1t-0006m7-Tc for guile-devel@m.gmane.org; Thu, 08 Jul 2010 07:12:33 -0400 Original-Received: from [140.186.70.92] (port=39566 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWp1p-0006jC-Eo for guile-devel@gnu.org; Thu, 08 Jul 2010 07:12:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWp1n-0003LO-RC for guile-devel@gnu.org; Thu, 08 Jul 2010 07:12:29 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:47822 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWp1n-00036M-PN for guile-devel@gnu.org; Thu, 08 Jul 2010 07:12:27 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 36D46C1C3A; Thu, 8 Jul 2010 07:10:58 -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=4I4wMARLm9epmrepdVCe0HWlW4U=; b=aEY7PO FdfK5WoOio8dT5ZJRIZhXq4R0H5A9metLv/iqL3uIHjnNLtmckpV+ORkHAS/VqGk 1SvGIxpOAsTy/gHykH5rGmiPSwT2ofyqTdeKtigGkllHz3E5AQQSz0DU70vZ/eTu x7KRUNctINtMwhWgl5PTHn4QhsBwvAN8hivD8= 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=rMi+TcfzfHci9Bj93mfr+4YrvgWYjhO5 X/h3K1CbGglWjp2LlZINELVt4MLNsxUktGIyDxTmifV1sjoylVNnR+VuRjTWXo7C DnXdvnKJK6GO7nJJ9F76cZiTIgoggJfW+FhMI2e09PLchOfauLS1N5FQC0ItjGWK a69kgTWVdFU= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 2474CC1C39; Thu, 8 Jul 2010 07:10:57 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [81.253.44.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id A9359C1C35; Thu, 8 Jul 2010 07:10:55 -0400 (EDT) In-Reply-To: (No Itisnt's message of "Fri, 2 Jul 2010 19:32:07 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 7B77170E-8A81-11DF-BD85-9056EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:10628 Archived-At: Hi, On Sat 03 Jul 2010 01:32, No Itisnt writes: > I've noticed while renovating my parser that it's pretty common for > unwanted values to weasel their way into tree-il. This patch adds an > optional else clause to unparse-tree-il, so when it's told to be > permissive, it will allow non-tree-il values through without error, so > as not to cause errors while printing errors etc. Looks good; a couple of comments inline. If you want to kill trailing whitespace, though, please do that as a separate commit, without any functional changes > -(define (unparse-tree-il tree-il) > +(define* (unparse-tree-il tree-il #:optional (permissive? #f)) #f is the default value, there is no need to mention it explicitly. > + (else > + (if permissive? > + tree-il > + (error "unhandled record in tree-il" tree-il))) > + )) Here we should produce a warning, I think, even if we are "permissive". Also please move the trailing parens to the previous line. Feel free to push when you have made these changes. Cheers, Andy -- http://wingolog.org/