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: [Emacs-diffs] trunk r117002: Correctly treat progn contents as toplevel forms when byte compiling Date: Tue, 22 Apr 2014 00:25:41 -0400 Message-ID: References: <535558EA.7070506@dancol.org> <53559BD2.3000006@dancol.org> <5355D244.2050104@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1398140774 27245 80.91.229.3 (22 Apr 2014 04:26:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Apr 2014 04:26:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 22 06:26:07 2014 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 1WcSHV-0002o5-C8 for ged-emacs-devel@m.gmane.org; Tue, 22 Apr 2014 06:26:05 +0200 Original-Received: from localhost ([::1]:52674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcSHU-0006Ft-V7 for ged-emacs-devel@m.gmane.org; Tue, 22 Apr 2014 00:26:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcSHL-0006D7-9X for emacs-devel@gnu.org; Tue, 22 Apr 2014 00:26:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcSHD-000759-QB for emacs-devel@gnu.org; Tue, 22 Apr 2014 00:25:55 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:51905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcSHD-00074w-Ka for emacs-devel@gnu.org; Tue, 22 Apr 2014 00:25:47 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s3M4PgDn007858; Tue, 22 Apr 2014 00:25:42 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D2A6C600CA; Tue, 22 Apr 2014 00:25:41 -0400 (EDT) In-Reply-To: <5355D244.2050104@dancol.org> (Daniel Colascione's message of "Mon, 21 Apr 2014 19:21:56 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4919=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4919> : inlines <752> : streams <1164282> : uri <1737019> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:171565 Archived-At: >> That's not the kind of example I was thinking if. Do you have a real >> example, maybe? > Try writing a macro that emits a defstruct, then a function that uses > cl-typep for that struct, all wrapped in the same toplevel progn. That's getting closer to an actual example. I still can't think of a case where you'd want to use cl-typep in this way, tho. > The reason we have automated tests is to make sure we can maintain this > "level of detail". That it's not immediately useful to you isn't a > reason not to include it. I can't believe this issue is even > contentious: the current behavior is a clear bug. It's a clear bug if we assume Common-Lisp semantics. But in many cases, Elisp chooses to provide simpler semantics, to allow a simpler and/or more naive implementation. I'm not yet convinced either way, but claiming it's a bug won't sway me. We've lived with a "simpler" semantics for 30 years and you're the first to complain about this limitation, so I'd really want to see clear evidence that it's worth adding this complexity. > we'd macroexpand-all?) in addition to emiting defmacros? What if the > macro generation is implicit, as it is with defstruct, so that the > top-level form doesn't even realize it has to employ this awful hack? Yes, the defstruct+typep example above sounds like a good example where my suggestion is not really workable. Stefan