help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Byte-compile constants in a function


From: Joe Riel
Subject: Re: Byte-compile constants in a function
Date: Wed, 4 Jul 2012 19:42:26 -0700

On Wed, 04 Jul 2012 09:26:06 -0400
Stefan Monnier <monnier@iro.umontreal.ca> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]