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] Prevent 'error' from being tail-called, for better diagnostics Date: Mon, 30 Jan 2012 12:05:25 +0100 Message-ID: <87zkd5wive.fsf@pobox.com> References: <87pqe1ithv.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 1327921554 10624 80.91.229.3 (30 Jan 2012 11:05:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 30 Jan 2012 11:05:54 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 30 12:05:52 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 1Rrp3U-0007Eh-7b for guile-devel@m.gmane.org; Mon, 30 Jan 2012 12:05:48 +0100 Original-Received: from localhost ([::1]:51013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrp3P-0004Oh-CC for guile-devel@m.gmane.org; Mon, 30 Jan 2012 06:05:43 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrp3I-0004OP-5J for guile-devel@gnu.org; Mon, 30 Jan 2012 06:05:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrp3C-0002zt-93 for guile-devel@gnu.org; Mon, 30 Jan 2012 06:05:36 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:60187 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrp3C-0002zp-5d for guile-devel@gnu.org; Mon, 30 Jan 2012 06:05:30 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id AF0907BDB; Mon, 30 Jan 2012 06:05:29 -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=zjBGelQSJ7f7tloWjf5gbSyHg64=; b=sSN5Az Z4dL03A/nFzYHm/GGzSvB2EceaPAmH3MabeotOwhebQ40tXbivxX6u9yH2RBOSHB 0XEyMq4CUAxT0WysQg721YtwnSo5vSTLejwcctLLAQApEcFX9xPFOLXpuUqXB8v+ 0ALk5FvMQ4hKZYuL8FjRGLizvuj9ayEaGQlAI= 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=L/7UQZSKvp9QGZ6Q7Pv6UzUNl3pes04J 8yA29MNwiHHoj2a2zqFB/QPmC8o/Sl5EDzdw3KTGtHwZFN3QsjOqunykgIO7ANtG jrnFQ8FvD7pH6rzWGurx89vypuqzMvD7TTNVC7j0lkzW0YPjS0g1hB6hN7Q/Mbbi 2QMKTiVLh9s= 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 A5BFC7BDA; Mon, 30 Jan 2012 06:05:29 -0500 (EST) Original-Received: from badger (unknown [90.163.36.89]) (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 109DB7BD9; Mon, 30 Jan 2012 06:05:28 -0500 (EST) In-Reply-To: <87pqe1ithv.fsf@netris.org> (Mark H. Weaver's message of "Mon, 30 Jan 2012 01:39:40 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: 51E41C66-4B32-11E1-902A-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:13743 Archived-At: On Mon 30 Jan 2012 07:39, Mark H Weaver writes: > When 'error' is called, the user should _automatically_ be told the > exact source location where it was called, and the procedure that called > it should be present in the backtrace. Therefore, we should somehow > prevent it from being tail-called. This is the argument behind R6RS's inclusion of "assert"; see section 11.14. > One idea is to change 'error' into a macro, and use tricks similar to > what 'load' does, to cleverly makes it look like a procedure. Unfortunately this is an incompatible change. Existing compiled files which reference the "error" binding expect it to be a procedure, not a macro. To provide this source information, a technique like this one might be applicable: http://funcall.blogspot.com/2009/05/you-knew-id-say-something-part-iv.html Until we do something to address this issue, we should probably document this aspect of the behavior of "error". Andy -- http://wingolog.org/