From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: non-local exits with signal and condition-case Date: Sun, 02 Jun 2013 20:02:16 -0400 Message-ID: References: <87ip1wjx9s.fsf@ferrier.me.uk> <87ehckjiyr.fsf@ferrier.me.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1370217763 3050 80.91.229.3 (3 Jun 2013 00:02:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Jun 2013 00:02:43 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nic Ferrier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 03 02:02:43 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UjIEV-0002EZ-2Y for ged-emacs-devel@m.gmane.org; Mon, 03 Jun 2013 02:02:43 +0200 Original-Received: from localhost ([::1]:56451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjIEU-0003Hy-IV for ged-emacs-devel@m.gmane.org; Sun, 02 Jun 2013 20:02:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjIEH-0003Gl-8S for emacs-devel@gnu.org; Sun, 02 Jun 2013 20:02:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjIE7-0007mj-7y for emacs-devel@gnu.org; Sun, 02 Jun 2013 20:02:29 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:11646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjIE6-0007mR-Sk for emacs-devel@gnu.org; Sun, 02 Jun 2013 20:02:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFpYtM/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNDRcTiAsGwS2RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFFFpYtM/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNDRcTiAsGwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="15449890" Original-Received: from 69-165-139-76.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.139.76]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 02 Jun 2013 20:02:12 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id CDC61AE168; Sun, 2 Jun 2013 20:02:16 -0400 (EDT) In-Reply-To: <87ehckjiyr.fsf@ferrier.me.uk> (Nic Ferrier's message of "Sun, 02 Jun 2013 22:33:48 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160014 Archived-At: > This is a heavily simplified version of something I just wrote for the > new elnode based emacswiki: Oh, I misunderstood, then: you're simulating "exceptions", which are called "signals" in Elisp, so you definitely want to use `signal' and `condition-case' here, rather than catch/throw. The only inconvenient is that signal names are global, so you need to use a name of the form "-redirect". I guess you could use an uninterned signal name, but it might be tricky to make use of that in a convenient way. >> You probably want to cons `errv' in front of inherits-list. > I thought about that before I sent it - I think you are probably > right. But my understanding is that you don't need the symbol to be > present; you can disassociate the symbol used to send the signal from > the symbol(s) used to capture it. Yes, if you don't put `errv' in there, indeed you dissociate the two, so you can't catch an "errv" with "errv" but only with one of its parents. > I think (as you suggest) a define-signal form should probably not > support that directly because it seems quite counter intuitive. Exactly. While it's technically possible, no signal does that and I can't think of any situation where someone would want to make use of such a "feature". So it's more likely to be a source of bugs and bug-reports than anything else. >> We could add it to subr.el (tho I'd call it define-signal). > Shall I send patches then? Yes. Please send them to bug-gnu-emacs@gnu.org. Stefan