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

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

Re: understanding backquote


From: Olaf Rogalsky
Subject: Re: understanding backquote
Date: Wed, 3 Jun 2015 03:57:38 -0400

> If you want to compute it at compile-time, use `eval-when-compile'.  E.g.
Another possibility would be, to use a temporary variable with lexical scope

(let ((tmp (* (+ 1 2) (+ 3 4))))
  (defun test () tmp))

or even a global variable:

(setq tmp (* (+ 1 2) (+ 3 4)))
(defun test () tmp))

This is not exactly the same as having a read-time evaluation of the 
expression, since it adds a variable dereferencing 
at run-time to the code. But it gets pretty close.

Olaf




reply via email to

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