all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 62746-done@debbugs.gnu.org, one.last.kiss@outlook.com
Subject: bug#62746: [PATCH] Updated Elispref-Manual: `nil' cannot be defuned
Date: Fri, 05 May 2023 10:01:24 -0400	[thread overview]
Message-ID: <jwvfs8aubdf.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <834jorjnas.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 May 2023 09:38:03 +0300")

>> >> “The symbols nil and void are Lisp objects, and can be stored into a
>> >>  function cell just as any other object can be (and they can be valid
>> >>  functions if you define them in turn with defun).”
>> >> 
>> >> Updated:
>> >> 
>> >> “The symbols nil and void are Lisp objects, and can be stored into a
>> >>  function cell just as any other object can be (and void can be a
>> >>  valid function if you define it with defun).”
>> >
>> > Why do you think the original text needs to be corrected?
>> 
>> Indeed, `nil` is treated specially to mean "not defined" when we try to
>> call a function:
>> 
>>     Lisp_Object
>>     funcall_general (Lisp_Object fun, ptrdiff_t numargs, Lisp_Object *args)
>>     {
>>       Lisp_Object original_fun = fun;
>>      retry:
>>       if (SYMBOLP (fun) && !NILP (fun)
>>           && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
>>         fun = indirect_function (fun);
>>     
>>       if (SUBRP (fun) && !SUBR_NATIVE_COMPILED_DYNP (fun))
>>         return funcall_subr (XSUBR (fun), numargs, args);
>>       else if (COMPILEDP (fun)
>>                || SUBR_NATIVE_COMPILED_DYNP (fun)
>>                || MODULE_FUNCTIONP (fun))
>>         return funcall_lambda (fun, numargs, args);
>>       else
>>         {
>>           if (NILP (fun))
>>             xsignal1 (Qvoid_function, original_fun);
>> 
>
> Thanks.  So I think our documentation is correct in this aspect, and
> I'm therefore closing this bug.

The current text suggest that `nil` "can be valid [a]
function if you define [it] in turn with defun", which is not really true.


        Stefan






  reply	other threads:[~2023-05-05 14:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10  8:33 bug#62746: [PATCH] Updated Elispref-Manual: `nil' cannot be defuned Shynur Xie
2023-04-10  8:50 ` Eli Zaretskii
2023-04-10  8:56   ` Shynur Xie
2023-04-10  9:02     ` Eli Zaretskii
2023-04-10  9:11       ` Shynur Xie
2023-04-10 14:14   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-05  6:38     ` Eli Zaretskii
2023-05-05 14:01       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-05-05 14:06         ` Eli Zaretskii
2023-05-05 18:04           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-06  9:49             ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfs8aubdf.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=62746-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=one.last.kiss@outlook.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.