emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Test your ELisp knowledge


From: Drew Adams
Subject: RE: [External] : Re: Test your ELisp knowledge
Date: Fri, 9 Feb 2024 15:12:47 +0000

> Me too but is it just because their-fun comes first in text order, e.g.
> M-: (+ (/ my-x 0) (their-fun))
> gives "(void-variable my-x)"

Yes, the args to `+' are evaluated in that
order.  (Similarly for all Elisp functions,
but not necessarily for macros and special
forms.)

But the error in the original case happens
because a sexp such as (their-fun ...)
could be a function call or a macro, with
an unknown/undefined `their-fun'.  Can't
assume that the args need to be evaluated.

Even though Elisp evaluates all args of a
function first-thing (applicative-order
evaluation), which would check `my-x',
it first has to find out if `their-fun'
is a function.

Functions such as `+' and `/' are known
(even built-in).

reply via email to

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