emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: display property strangeness


From: Luc Teirlinck
Subject: Re: display property strangeness
Date: Sun, 13 Mar 2005 15:25:02 -0600 (CST)

Nick Roberts wrote:

   As someone who doesn't have a background in Lisp, I would expect executing
   the same statement three times to give the same result as executing three
   identical statements.

I guess that with "executed three times" you mean read and evaluated
three times.  The way I understand it, it is not.  It is read once and
evaluated three times.  Reading transforms "a" into a Lisp object.
Then that object gets evaluated three times.  _Evaluating_ a constant
just returns the identical constant.

Maybe this could be pointed out explicitly in `(elisp)Iteration'.

The situation is similar to:

ELISP> (defun ff () "a")
ff
ELISP> (eq (ff) (ff))
t

When the defun is read, the Lisp object "a" is produced.  That Lisp
object gets evaluated when the function is called, which returns the
identical constant stored in the function cell.

I do not know what Miles meant by "bog standard".  The above behavior
does indeed seem standard for Lisp dialects.  It also occurs in Common
Lisp.  Many other interactive languages indeed read _and_ execute
repeatedly in loops as well as in function calls, producing many
non-identical objects.  (Which seems very inefficient.)

Sincerely,

Luc.




reply via email to

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