emacs-devel
[Top][All Lists]
Advanced

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

Re: New branch feature/named-lambdas.


From: Philip Kaludercic
Subject: Re: New branch feature/named-lambdas.
Date: Mon, 17 Jul 2023 19:52:01 +0000

Alan Mackenzie <acm@muc.de> writes:

> Hello, Emacs.
>
> I've just committed the first version of branch feature/named-lambdas.
>
> This will output the @dfn{defining symbol} of any anonymous functions in
> backtraces.
>
> For example, in
>
>     (defun foo ()
>       "foo doc string"
>       (lambda (bar) "lambda doc string" (car bar)))
>
> M-: (funcall (foo) 'baz) will produce this backtrace:
>
> Debugger entered--Lisp error: (wrong-type-argument listp baz)
>   car(baz)
>   {foo} #f(compiled-function (bar) "lambda doc string" #<bytecode 
> -0x105933d3d8452e4e>)(baz)  <=============================
>   funcall({foo} #f(compiled-function (bar) "lambda doc string" #<bytecode 
> -0x105933d3d8452e4e>) baz)
>   (progn (funcall (foo) 'baz))
>   elisp--eval-last-sexp(nil)
>   eval-last-sexp(nil)
>   funcall-interactively(eval-last-sexp nil)
>   command-execute(eval-last-sexp)
>
> ..  Note the {foo} on the third and fourth lines.  This is (usually) the
> defun where the lambda was defined, and is helpful in locating its
> source code.
>
> This was achieved by adding an extra defining-symbol field to each of
> the three forms of function (interpreted, byte-compiled,
> native-compiled).  It is indended that this version of Emacs will
> continue to handle functions compiled without this enhancement.

I think the idea is nice, but there are a lot of whitespace changes in
your commit that make identifying the real changes a bit difficult.



reply via email to

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