all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: tpeplt <tpeplt@gmail.com>
To: Michael Heerdegen via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Cc: Michael Heerdegen <michael_heerdegen@web.de>
Subject: Re: Lambdas for beginners broken - help, please
Date: Wed, 24 Jul 2024 15:29:29 -0400	[thread overview]
Message-ID: <87r0bivbae.fsf@gmail.com> (raw)
In-Reply-To: <875xsu1v7o.fsf@web.de> (Michael Heerdegen via Users list for the's message of "Wed, 24 Jul 2024 20:49:31 +0200")

Michael Heerdegen via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> tpeplt <tpeplt@gmail.com> writes:
>
>>    This matches the (soon to be out of date?) behavior documented in 
>>    (info "(elisp) Function Cells").
>
> I don't follow - what has to be changed in (info "(elisp) Function
> Cells")?  Stefan had updated that node along with the introduction of
> the new function type.
>
> Michael.
>
>

I do not have a version of Emacs built from the latest development
sources, but according to the OP:

>
> the current info manual says this,
>
>   (defun bar (n) (+ n 2))
>   (symbol-function 'bar)
>     ;; -> #f(lambda (n) [t] (+ n 2))
>
> and if I run the code myself(*) I get this:
>
>   (defun bar (n) (+ n 2))
>   (symbol-function 'bar)
>     ;; -> #[(n) ((+ n 2)) nil]
>

If what is written by the OP correctly describes what happens with the
latest development sources, then the description in the manual:

>  #f(lambda (n) [t] (+ n 2))

is not the same as what comes from evaluation:

>   #[(n) ((+ n 2)) nil]

However, it was not clear (to me) that the OP was evaluating the
expressions with ‘lexical-binding’ set to T or NIL, which would affect
the evaluation result.

Also, my reply was meant to help illustrate that Emacs 29 does not show
the discrepancy between documentation and evaluation that the OP
describes.  Does this make his question more appropriate for the
‘emacs-devel’ mailing list?

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.



  reply	other threads:[~2024-07-24 19:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24  8:43 Lambdas for beginners broken - help, please Eduardo Ochs
2024-07-24 13:12 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-24 16:43   ` Eduardo Ochs
2024-07-24 20:03     ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-24 22:06       ` Eduardo Ochs
2024-07-25  5:18       ` Eli Zaretskii
2024-07-25  9:44         ` Eduardo Ochs
2024-07-25 11:33           ` Eli Zaretskii
2024-07-25 12:49             ` Eduardo Ochs
2024-07-25 14:53               ` Eli Zaretskii
2024-07-24 16:54 ` tpeplt
2024-07-24 18:49   ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-24 19:29     ` tpeplt [this message]
2024-07-24 19:58       ` Michael Heerdegen via Users list for the GNU Emacs text editor

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=87r0bivbae.fsf@gmail.com \
    --to=tpeplt@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.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 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.