From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Riel Newsgroups: gmane.emacs.help Subject: Re: Byte-compile constants in a function Date: Wed, 4 Jul 2012 19:42:26 -0700 Organization: Maplesoft Message-ID: <20120704194226.25246b60@gauss> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341456171 22540 80.91.229.3 (5 Jul 2012 02:42:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jul 2012 02:42:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 05 04:42:51 2012 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Smc1m-00018J-7D for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Jul 2012 04:42:46 +0200 Original-Received: from localhost ([::1]:41216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Smc1l-0000cS-6p for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 22:42:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Smc1g-0000c3-7q for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 22:42:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Smc1e-00030B-Iz for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 22:42:39 -0400 Original-Received: from autodiscover.maplesoft.com ([199.71.183.105]:39795 helo=ICW8KMAI01.maplesoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Smc1e-0002zr-FG for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 22:42:38 -0400 Original-Received: from gauss (10.10.50.20) by ICW8KMAI01.maplesoft.com (10.10.1.104) with Microsoft SMTP Server (TLS) id 8.3.245.1; Wed, 4 Jul 2012 22:43:19 -0400 In-Reply-To: X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP2+, XP SP1+ (seldom 98) X-Received-From: 199.71.183.105 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85668 Archived-At: On Wed, 04 Jul 2012 09:26:06 -0400 Stefan Monnier wrote: > > (defconst tag-prompt ?>) > > (defun check (char) (eq char tag-prompt)) > > You can do > > (eval-when-compile > (defconst tag-prompt ?>)) > > (defun check (char) (eq char (eval-when-compile tag-prompt))) > > > -- Stefan Thanks, that seems nicer than using defsubst. Possibly with that I'll finally understand what eval-when-compile is all about. -- Joe Riel