unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: emacs-devel@gnu.org
Subject: Re: What does an OClosure look like?
Date: Thu, 2 Mar 2023 21:49:10 +0000	[thread overview]
Message-ID: <ZAEZ1vLTtGEuMD5R@ACM> (raw)
In-Reply-To: <871qm848dq.fsf@web.de>

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).



      reply	other threads:[~2023-03-02 21:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 22:08 What does an OClosure look like? Alan Mackenzie
2023-03-01 18:46 ` Michael Heerdegen
2023-03-02 21:49   ` Alan Mackenzie [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=ZAEZ1vLTtGEuMD5R@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).