From: Drew Adams <drew.adams@oracle.com>
To: Peter Hull <peterhull90@gmail.com>,
Joost Kremers <joostkremers@fastmail.fm>
Cc: "tomas@tuxteam.de" <tomas@tuxteam.de>,
"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: [External] : Re: Test your ELisp knowledge
Date: Fri, 9 Feb 2024 15:12:47 +0000 [thread overview]
Message-ID: <SJ0PR10MB548836B24F72D1B3E5052110F34B2@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <CAK9Gx1fa_ewK6mzMKHCbjTiTcaMrNBtMTqYjAYhO7DTqW=hJUQ@mail.gmail.com>
> 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).
next prev parent reply other threads:[~2024-02-09 15:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-09 2:52 Test your ELisp knowledge Stefan Monnier
2024-02-09 4:23 ` [External] : " Drew Adams
2024-02-09 4:29 ` Yuri Khan
2024-02-09 5:26 ` Po Lu
2024-02-09 10:52 ` Manuel Giraud via Emacs development discussions.
2024-02-09 11:26 ` tomas
2024-02-09 12:10 ` Joost Kremers
2024-02-09 12:54 ` Peter Hull
2024-02-09 15:12 ` Drew Adams [this message]
2024-02-09 12:31 ` Manuel Giraud via Emacs development discussions.
2024-02-09 12:56 ` tomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR10MB548836B24F72D1B3E5052110F34B2@SJ0PR10MB5488.namprd10.prod.outlook.com \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=joostkremers@fastmail.fm \
--cc=peterhull90@gmail.com \
--cc=tomas@tuxteam.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).