help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Lambdas for beginners broken - help, please


From: Michael Heerdegen
Subject: Re: Lambdas for beginners broken - help, please
Date: Wed, 24 Jul 2024 22:03:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eduardo Ochs <eduardoochs@gmail.com> writes:

>   lambda is a Lisp macro in ‘subr.el’.
>
>   (lambda ARGS [DOCSTRING] [INTERACTIVE] BODY)
>
>   Return an anonymous function.
>   Under dynamic binding, a call of the form (lambda ARGS DOCSTRING
>   INTERACTIVE BODY) is self-quoting; the result of evaluating the
>   lambda expression is the expression itself.

Agreed, this is at least misleading.  Stefan, Eli?



> So, question: is there a recommended way to convert the result of
>
>   (eval '(lambda (n) (+ n 2)) nil)
>
> back to the
>
>   (lambda (n) (+ n 2))
>
> ?

If you really think you want to do this - have a look at "cl-print.el" and
the implementation of `cl-print-object' for interpreted-function
arguments, starting around line number 240.  This shows how to dissect
those objects.


Michael.




reply via email to

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