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: Tue, 3 Jul 2012 23:07:36 -0700

On Tue, 3 Jul 2012 13:26:13 -0700 (PDT)
José A. Romero L. <escherdragon@gmail.com> wrote:

> W dniu wtorek, 3 lipca 2012 18:57:12 UTC+2 użytkownik Joe Riel napisał:
> > Is there a way to define constant/macros so that the value is expanded
> > during byte-compilation of a function that uses them?
> (...)
> 
> How about defining an inlined function that returns the constant
> you need?
> 
>     (defsubst tag-prompt () ?>)
> 
> then:
> 
>     (defun check (char) (eq char (tag-prompt)))
> 
> a quick look at the byte-compiled code shows that the value
> of (tag-prompt) is indeed inlined.

Thanks, that does what I want.

-- 
Joe Riel




reply via email to

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