From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Achim Gratz Newsgroups: gmane.emacs.devel Subject: Re: eval-when-compile Date: Wed, 08 Aug 2012 20:51:18 +0200 Organization: Linux Private Site Message-ID: <87a9y5w72x.fsf@Rainer.invalid> References: <871ujx94qo.fsf@Rainer.invalid> <871ujxd8in.fsf@kuiper.lan.informatimago.com> <87y5m5rt31.fsf@Rainer.invalid> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1344451906 8046 80.91.229.3 (8 Aug 2012 18:51:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Aug 2012 18:51:46 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 08 20:51:47 2012 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 1SzBM9-0001cb-Sr for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2012 20:51:46 +0200 Original-Received: from localhost ([::1]:52541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzBM9-0006sF-7M for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2012 14:51:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzBM6-0006rz-Cv for emacs-devel@gnu.org; Wed, 08 Aug 2012 14:51:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzBM5-0008Tt-7J for emacs-devel@gnu.org; Wed, 08 Aug 2012 14:51:42 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzBM5-0008Tn-08 for emacs-devel@gnu.org; Wed, 08 Aug 2012 14:51:41 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SzBM3-0001Ro-4u for emacs-devel@gnu.org; Wed, 08 Aug 2012 20:51:39 +0200 Original-Received: from pd9eb48b4.dip.t-dialin.net ([217.235.72.180]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Aug 2012 20:51:39 +0200 Original-Received: from Stromeko by pd9eb48b4.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Aug 2012 20:51:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: pd9eb48b4.dip.t-dialin.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) Cancel-Lock: sha1:eBkWACZEGjxz8vYpX4wI/WD1GDA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:152349 Archived-At: PJ Weisberg writes: > You know what you could do? > > --- > (eval > (eval-when-compile > (if nil > '(defvar quoted-t "true") > '(defvar quoted-nil "false"))) > --- > > That'll compile to: > > --- > (eval > '(defvar quoted-nil "false")) > --- Thanks. I tried this and actually it compiles to just (defvar quoted-nil "false") as I expected my first variant to do. I am not sure what the outer eval is doing, though: it doesn't look like it is executed at compile-time, so it must somehow be optimized away by the byte-compiler (some rule that "(eval (quote <…>))" is identical to "<…>", perhaps?). Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada