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: Sat, 20 Nov 2010 16:23:44 +0100 Message-ID: References: <87sjzvnu1i.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 1290266458 2664 80.91.229.12 (20 Nov 2010 15:20:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 20 Nov 2010 15:20:58 +0000 (UTC) Cc: Guile Development To: Andreas Rottmann Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Nov 20 16:20:54 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 1PJpFD-0008At-U2 for guile-devel@m.gmane.org; Sat, 20 Nov 2010 16:20:52 +0100 Original-Received: from localhost ([127.0.0.1]:41649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJpFD-0008GQ-CF for guile-devel@m.gmane.org; Sat, 20 Nov 2010 10:20:51 -0500 Original-Received: from [140.186.70.92] (port=47794 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJpFA-0008GE-6Q for guile-devel@gnu.org; Sat, 20 Nov 2010 10:20:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJpF8-0004tu-VL for guile-devel@gnu.org; Sat, 20 Nov 2010 10:20:48 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:47869 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJpF8-0004j4-Su for guile-devel@gnu.org; Sat, 20 Nov 2010 10:20:46 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 2F4AB256D; Sat, 20 Nov 2010 10:20:00 -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=6liCWX7IhqYZiux6vdSjGrDwM34=; b=oV/AN+ rK4RPwonHR+4HLlbSZ1PjxfxDlW29vwJVNvGC2Pp7XMlWCQLgWWlyr1ptxU+eGgx nKPjOpiNcw+QO5YZwBFuH3ZqYCCj41wkAciaWBjHSo+FScOkgM0hsICIHBH3wM8G ytM4pGuXAWL9fZz5882Eo7ZbvVPRZqUuI9h5g= 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=wC5iNAVsBfEqE5tzZ0Vp3t0yEP0flWUJ j2AcsOzBc5yNTbGkBD9qWgTeNz5hdJiRslJhEghiw+aZHNwRh+ezHxz0pBnJbswq 78y5xxTSb5VmoWgYbCws6XDb0+XsUHAruR3sj/iqa8vfEkAkyCU/xzNUhWaYXyDC 4jBNBSu8Ko0= 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 1DB3E256C; Sat, 20 Nov 2010 10:19:59 -0500 (EST) Original-Received: from unquote.localdomain (unknown [88.0.167.219]) (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 605DF256B; Sat, 20 Nov 2010 10:19:57 -0500 (EST) In-Reply-To: <87sjzvnu1i.fsf@delenn.lan> (Andreas Rottmann's message of "Sun, 24 Oct 2010 23:46:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: A35576F6-F4B9-11DF-986D-B53272ABC92C-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:11158 Archived-At: On Sun 24 Oct 2010 23:46, Andreas Rottmann writes: > Attached is a patch that improves the way R6RS exceptions are printed at > the REPL Cool! I have also found the need to define pretty-printers for various throw keys. I wonder, could you rework this patch to add a more generic exception-printing mechanism? I'm going to display my ignorance in public and try to write down some types. := is a type definition, and : declares the type of something. exception-printer := port args -> nothing set-exception-printer! : exception-printer -> nothing exception-printer : key -> exception-printer print-exception : key args port -> nothing The default behavior could be hard-coded into print-exception. The first two procedures (set-exception-printer!, exception-printer, and print-exception) could go into boot-9, and the third into (system repl error-handling), or a new module under ice-9. What do you think? Regards, Andy -- http://wingolog.org/