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: [PATCH] New convenience macros Date: Thu, 23 Aug 2007 15:12:09 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187896342 10211 80.91.229.12 (23 Aug 2007 19:12:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Aug 2007 19:12:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 23 21:12:18 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IOI6J-0002E3-UP for ged-emacs-devel@m.gmane.org; Thu, 23 Aug 2007 21:12:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IOI6J-00021Q-7O for ged-emacs-devel@m.gmane.org; Thu, 23 Aug 2007 15:12:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IOI6F-00020l-O5 for emacs-devel@gnu.org; Thu, 23 Aug 2007 15:12:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IOI6F-00020X-Cm for emacs-devel@gnu.org; Thu, 23 Aug 2007 15:12:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IOI6F-00020U-72 for emacs-devel@gnu.org; Thu, 23 Aug 2007 15:12:11 -0400 Original-Received: from bc.sympatico.ca ([209.226.175.184] helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IOI6E-0001Bj-TJ for emacs-devel@gnu.org; Thu, 23 Aug 2007 15:12:11 -0400 Original-Received: from ceviche.home ([70.55.80.33]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070823191209.KJCM18413.tomts22-srv.bellnexxia.net@ceviche.home> for ; Thu, 23 Aug 2007 15:12:09 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 6325370168; Thu, 23 Aug 2007 15:12:08 -0400 (EDT) In-Reply-To: (Steve Youngs's message of "Fri\, 24 Aug 2007 04\:24\:04 +1000") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:77045 Archived-At: >>> (if (and (featurep 'simple) (featurep 'xemacs)) a b) >>> warns about free variables for both `a' and `b'. So I think having the >> That's a valid criticism, but I fail to see how your macros would fare any >> better on the above kind of code. I.e. what code would you write instead of >> the above, using your macros? > (or (do-in-xemacs (when (featurep 'simple) a)) b) Aka (or (if (featurep 'xemacs) (when (featurep 'simple) a)) b) which would naturally be rewritten as (if (and (featurep 'xemacs) (featurep 'simple)) a b) > (with-emacs-type 'xemacs (when (featurep 'simple) a)) > (with-emacs-type 'emacs b) (if (featurep 'xemacs) (when (featurep 'simple) a)) (unless (featurep 'xemacs) b) which would naturally be rewritten as (if (featurep 'xemacs) (when (featurep 'simple) a) b) > Both only warn about `b' and the resulting bytecode has no mention of > `a'. Same for my alternatives, which are the most obvious translations of your code. Note that the macro form is never simpler or clearer. So I really fail to see the value of those macros. Stefan