all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 70368@debbugs.gnu.org
Subject: bug#70368: [PATCH] Use a dedicated type to represent interpreted-function values
Date: Thu, 18 Apr 2024 19:49:36 +0300	[thread overview]
Message-ID: <86mspqd3a7.fsf@gnu.org> (raw)
In-Reply-To: <jwv34rivdcs.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Thu, 18 Apr 2024 12:36:36 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: 70368@debbugs.gnu.org
> Date: Thu, 18 Apr 2024 12:36:36 -0400
> 
> OK, I've updated my patch according to your suggestions, see the result
> below (and in the `scratch/interpreted-function` branch).
> Any further comment/objection?

Just a few minor nits, really.

> >From 7842af6095db4384898725fb4a14ebaa11379a34 Mon Sep 17 00:00:00 2001
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sun, 24 Mar 2024 18:32:25 -0400
> Subject: [PATCH 1/2] (COMPILED): Rename to CLOSURE
> 
> In preparation for the use of `PVEC_COMPILED` objects for
> interpreted functions, rename them to use a more neutral name.
> 
> * src/lisp.h (enum pvec_type): Rename `PVEC_COMPILED` to `PVEC_CLOSURE`.
> (enum Lisp_Compiled): Use `CLOSURE_` prefix i.s.o `COMPILED_`.
> Also use `CODE` rather than `BYTECODE`.
> (CLOSUREP): Rename from `COMPILEDP`.
> (enum Lisp_Closure): Rename from `Lisp_Compiled`.
> 
> * src/alloc.c, src/bytecode.c, src/comp.c, src/data.c, src/eval.c,
> * src/fns.c, src/lisp.h, src/lread.c, src/pdumper.c, src/print.c,
> * src/profiler.c: Rename all uses accordingly.
> * src/.gdbinit (xclosure): Rename from `xcompiled`.
> (xcompiled): New obsolete alias.
> (xpr): Adjust accordingly.  Also adjust to new PVEC_CLOSURE tag name.

You are still quoting `like this`.

> +Thus code that attempts to "dig" into the internal structure of an
> +interpreted function's object with the likes of 'car' or 'cdr' will
> +no longer work and will need to use 'aref' used instead to extract its
                                              ^^^^
That "used" should be removed.

> +DEFUN ("closurep", Fclosurep, Sclosurep,
> +       1, 1, 0,
> +       doc: /* Return t if OBJECT is a function of type `closure'.  */)
> +  (Lisp_Object object)
> +{
> +  if (CLOSUREP (object))
> +    return Qt;
> +  return Qnil;
> +}

This new function should be in NEWS.

> +DEFUN ("interpreted-function-p", Finterpreted_function_p,
> +       Sinterpreted_function_p, 1, 1, 0,
> +       doc: /* Return t if OBJECT is a function of type `interpreted-function'.  */)
> +  (Lisp_Object object)

Likewise.

> +DEFUN ("make-interpreted-closure", Fmake_interpreted_closure,
> +       Smake_interpreted_closure, 3, 5, 0,
> +       doc: /* Make an interpreted closure.
> +ARGS should be the list of formal arguments.
> +BODY should be a non-empty list of forms.
> +ENV should be a lexical environment, like the second argument of `eval'.
> +IFORM if non-nil should be of the form (interactive ...).  */)
> +  (Lisp_Object args, Lisp_Object body, Lisp_Object env,
> +   Lisp_Object docstring, Lisp_Object iform)

Likewise.

Thanks.





  reply	other threads:[~2024-04-18 16:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-13 19:56 bug#70368: [PATCH] Use a dedicated type to represent interpreted-function values Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14  5:32 ` Eli Zaretskii
2024-04-14 13:49   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14 14:45     ` Eli Zaretskii
2024-04-14 23:03       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 11:23         ` Eli Zaretskii
2024-04-15 12:22           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 13:10             ` Eli Zaretskii
2024-04-18 16:36               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 16:49                 ` Eli Zaretskii [this message]
2024-04-28 16:05                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29  9:05                     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 17:15                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 11:38                     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 17:18                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 17:30                         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 12:49                         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 13:51                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 15:02                             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 15:19                             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 18:34                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-01 12:35                                 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14 16:18     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14 19:11       ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=86mspqd3a7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70368@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.