From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: What does an OClosure look like? Date: Thu, 2 Mar 2023 21:49:10 +0000 Message-ID: References: <871qm848dq.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2797"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 02 22:50:22 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXqof-0000RF-D2 for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Mar 2023 22:50:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXqnu-0001Gy-Ax; Thu, 02 Mar 2023 16:49:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXqnq-0001GS-6H for emacs-devel@gnu.org; Thu, 02 Mar 2023 16:49:30 -0500 Original-Received: from mx3.muc.de ([193.149.48.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXqno-00055y-6H for emacs-devel@gnu.org; Thu, 02 Mar 2023 16:49:29 -0500 Original-Received: (qmail 88440 invoked by uid 3782); 2 Mar 2023 22:49:14 +0100 Original-Received: from acm.muc.de (pd953aa32.dip0.t-ipconnect.de [217.83.170.50]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 02 Mar 2023 22:49:14 +0100 Original-Received: (qmail 10970 invoked by uid 1000); 2 Mar 2023 21:49:10 -0000 Content-Disposition: inline In-Reply-To: <871qm848dq.fsf@web.de> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303902 Archived-At: Hello, Michael. On Wed, Mar 01, 2023 at 19:46:41 +0100, Michael Heerdegen wrote: > Alan Mackenzie 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).