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: R6RS exception printing at the REPL Date: Mon, 29 Nov 2010 21:34:28 +0100 Message-ID: References: <87sjzvnu1i.fsf@delenn.lan> <87tyjbkger.fsf@delenn.lan> <87ipzj631y.fsf@delenn.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291062637 3051 80.91.229.12 (29 Nov 2010 20:30:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Nov 2010 20:30:37 +0000 (UTC) Cc: ludo@gnu.org, Guile Development To: Andreas Rottmann Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Nov 29 21:30:32 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 1PNAMo-0004a9-SE for guile-devel@m.gmane.org; Mon, 29 Nov 2010 21:30:31 +0100 Original-Received: from localhost ([127.0.0.1]:34821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNAMj-0005fO-Ba for guile-devel@m.gmane.org; Mon, 29 Nov 2010 15:30:25 -0500 Original-Received: from [140.186.70.92] (port=39436 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNAMg-0005f7-DC for guile-devel@gnu.org; Mon, 29 Nov 2010 15:30:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNAMe-0000Ad-WC for guile-devel@gnu.org; Mon, 29 Nov 2010 15:30:22 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:56079 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNAMe-0000AR-QR; Mon, 29 Nov 2010 15:30:20 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id BF9643865; Mon, 29 Nov 2010 15:30:37 -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=zGV8sD73F8qyD7OqpioCvhrzdUk=; b=kCTNpS 9qX8I2B/JKFuR2GakedWux4qoFxpjM1RChgcr71dNkz7Eji6Ox+xnzosh+8Nusst bpztppoHhNFvBwbq1nglroaJqpgUQIwvtA0rcolno4Mu1oI2aombCGZueB0NFfl0 USazhiJ7j+Yxh7YCGehpCO2REOT1NpV9x3Y20= 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=aaAeG9ZBnLGGqnpSKBrL88XC4zJO8CTI 7p2JyRxVf9Gb4a1dHZ9xsPv8EqVN9ui/quSUxQXdCmPWBBkAKWqGTsIGhvnlFlK2 d/RwAOlGX1yk5wOBkyP4arGgB9jqTY9iFRAovCLIlLOnblWKiAZP7rpxBLQqL660 DomaEzOXMko= 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 9BEF43864; Mon, 29 Nov 2010 15:30:35 -0500 (EST) Original-Received: from unquote.localdomain (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 7AB813863; Mon, 29 Nov 2010 15:30:32 -0500 (EST) In-Reply-To: <87ipzj631y.fsf@delenn.lan> (Andreas Rottmann's message of "Sat, 27 Nov 2010 01:08:41 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 8547235E-FBF7-11DF-8AC9-CDEAE6EC64FC-02397024!a-pb-sasl-sd.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:11221 Archived-At: On Sat 27 Nov 2010 01:08, Andreas Rottmann writes: > to not lose current functionality, `print-exception' and exception > printer procedures would need a `frame' argument as well, right? I guess. I never liked that, though; sounds like a needless tangling of concerns. What does having the frame give us? Just source, or the function name, or what? It seems like a message about the context in which the error occurred could just as well come before the error is printed out. What do you think? What does Ludovic think? :) >> For r6rs exceptions, I think either (rnrs conditions) or (rnrs >> exceptions). >> > Ideally I'd like to put it into its own module. The exception printer > should be able to freely use all of R6RS I understand the attraction of the "closure" aspects here (R6RS-in-R6RS), but if you don't absolutely need higher levels of the R6RS stack I would prefer for it to be implemented in (rnrs conditions) or (rnrs exceptions), for the reason that you mention: > the separate-module approach will not work with the proposed exception > printer registry unless the module registering the handler is actually > loaded So let's keep the mechanism simple, if possible. > `raise' and the condition system (for both the SRFI and R6RS > varieties) are orthogonal, even if they are most often used together. I wasn't aware that this was the case for r6rs as well; interesting. Well I suppose it's also possible for someone to throw something unexpected to misc-error or to system-error. > A possible solution might be to allow an exception printer to decline > to handle a specific raised object, and fall back on the default > behavior. > exception-printer := port args -> boolean I like this suggestion; but I think the return value aspect is too tricky. People will end up relying on the return value of whatever the last function in the printer is, and that could be unspecified, and indeed "unspecified values"... better to be explicit. So instead, how about exception-printer: port args exception-printer Does that make sense at all? If the given printer doesn't like the args, it calls the default printer given to it as an arg. Anyway, so much API noodling over a small thing; but I do think it will make Guile hacking better. Cheers, Andy -- http://wingolog.org/