[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What does an OClosure look like?
From: |
Alan Mackenzie |
Subject: |
Re: What does an OClosure look like? |
Date: |
Thu, 2 Mar 2023 21:49:10 +0000 |
Hello, Michael.
On Wed, Mar 01, 2023 at 19:46:41 +0100, Michael Heerdegen wrote:
> Alan Mackenzie <acm@muc.de> writes:
> > I'm currently experimenting with the layout of lambda forms. In doing
> > so, I've hit a cl-assert in oclosure.el.
> Maybe show your code.
Er, the diff file is approaching 1000 lines at the moment. ;-)
> > I can't find a description of an oclosure in that source file, nor in
> > the section in the elisp manual. By description, I mean what an
> > oclosure structure looks like in terms of conses and lists.
> AFAIU these are ATM more or less normal function values with some meta
> data stored at some place that does not change the "behavior" (see
> `oclosure-type') when funcalling the thing.
> The cl related part implements the type handling and the
> semantics of this "meta data" (accessors).
> A byte code oclosure can't be described in terms of conses and lists of
> course. What's your use case so that these internal implementation
> details matter?
I'm trying to change the layout of lambda forms. This involves changing
the layout of oclosures. In particular, I'm trying to add a field to a
lambda which identifies the enclosing defun or macro, so that this can
be output on backtraces. Currently very little information appears on
backtraces about lambda functions.
I got where I needed to go a few days ago, but it cost several hours of
tedious source reading. Oclosures also mess with the function Ffunction
in eval.c, which didn't make things easier.
Still I fixed the bugs I introduced.
Thanks for the reply!
> Michael.
--
Alan Mackenzie (Nuremberg, Germany).