From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Reimplement module functions Date: Sun, 14 May 2017 18:08:34 +0000 Message-ID: References: <20170513144408.14057-1-phst@google.com> <83fug88z76.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1141fbd657cb0e054f7fd475" X-Trace: blaine.gmane.org 1494785336 6070 195.159.176.226 (14 May 2017 18:08:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 May 2017 18:08:56 +0000 (UTC) Cc: phst@google.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 14 20:08:53 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9xwp-0001Ss-Dy for ged-emacs-devel@m.gmane.org; Sun, 14 May 2017 20:08:51 +0200 Original-Received: from localhost ([::1]:33537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9xwu-0004pN-MF for ged-emacs-devel@m.gmane.org; Sun, 14 May 2017 14:08:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9xwn-0004p6-VW for emacs-devel@gnu.org; Sun, 14 May 2017 14:08:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9xwm-0000zf-T8 for emacs-devel@gnu.org; Sun, 14 May 2017 14:08:49 -0400 Original-Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:37336) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9xwl-0000wj-4L; Sun, 14 May 2017 14:08:47 -0400 Original-Received: by mail-wm0-x22e.google.com with SMTP id d127so53783265wmf.0; Sun, 14 May 2017 11:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7TdP3k/0Y06j/v+DZ+uu5UjcowFy/UR+GJwCPsi0dww=; b=tNQoKgX/uRRXVvsmOBYy6UmyL3iURuP4XI7M5p/SwNEPpOXGAbiADBfWgzPvuttjLR zMQu2EOz7JUjkAeZIByThlAFNRfuhaUm0OGCDga52LDIyg0q9t+Z73jjWaE4QXlZafmB D5aW0WZzrfo+oNmEBYWvSHAduCwxawthdfysr04kOZYwikvT5y7tu1saLTNP13TN0WGk pqGBOHL3U8pxAPFY/fKHf1uJqEXEzO+J4y3wvanDRq9yP89VSoMsT9Akog8R+BcXO00h CdxzAriyHAmWTCVWS0nrTqljMTEmmYCI2rofyFkZ1vPo9yH4XWLY80zIajp9QREfA4Aw zOkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7TdP3k/0Y06j/v+DZ+uu5UjcowFy/UR+GJwCPsi0dww=; b=SjH3bWPBcKLBAb+hPK/5xxfiiXBYo2czga2PaZqbu7a/eg02xCo2h4AcUEK7ztfgOn 0WLEOz/KlAZ+asI1idGuvHZtuMDIJRfQqpZg5njPaWjRPwB1saJtU6TamcXwi4Rf7O2A sXtsCbaVsALVSNcXUBJb1hrmnccZ66W8AAv6lu7gW9xV21fRfu3iKUJu9Z73aXgQvlUI YaplGjh9ln3+0DGCappQvzvpmfTQLPKWMB4c1nuoSckgkWAMZ7bv8YxO/7Ub/zfcdRu/ eD+MQ/wbyORuZm2Nx9GsnRD7twDrk5GvhvXqFdVbtsenJR7cKSJuRELOdSdhhw/J1a9P KhGg== X-Gm-Message-State: AODbwcAZZBxkECCZ16JuR8Og3e7oWx0myHydqt7gjKERxoZHxTs3BI0H znWuIrCxVLN7Iiud3nThaLnEtfZzS8I0 X-Received: by 10.28.172.69 with SMTP id v66mr1612104wme.46.1494785325515; Sun, 14 May 2017 11:08:45 -0700 (PDT) In-Reply-To: <83fug88z76.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214843 Archived-At: --001a1141fbd657cb0e054f7fd475 Content-Type: text/plain; charset="UTF-8" Eli Zaretskii schrieb am Sa., 13. Mai 2017 um 19:05 Uhr: > > From: Philipp Stephani > > Date: Sat, 13 May 2017 16:44:08 +0200 > > Cc: Philipp Stephani > > > > Instead of a lambda, create a new type containing all data required to > > call the function, and support it in the evaluator. Because this type > > now also needs to store the function documentation, it is too big for > > Lisp_Misc; use a pseudovector instead. That also has the nice benefit > > that we don't have to add special support to the garbage collector. > > Thanks. > > > +#ifdef HAVE_MODULES > > + else if (MODULE_FUNCTIONP (fun)) > > + doc = XMODULE_FUNCTION (fun)->documentation; > > +#endif > > I wonder whether it would be cleaner to have MODULE_FUNCTIONP defined > even when HAVE_MODULES is not: it looks like it could save us quite a > few #ifdef's. > Done. > > > -DEFUN ("internal--module-call", Finternal_module_call, > Sinternal_module_call, 1, MANY, 0, > > - doc: /* Internal function to call a module function. > > -ENVOBJ is a save pointer to a module_fun_env structure. > > -ARGLIST is a list of arguments passed to SUBRPTR. > > -usage: (module-call ENVOBJ &rest ARGLIST) */) > > - (ptrdiff_t nargs, Lisp_Object *arglist) > > +Lisp_Object > > +funcall_module (const struct Lisp_Module_Function *const envptr, > > + ptrdiff_t nargs, Lisp_Object *arglist) > > { > > I don't think we can simply remove a function that was already present > in one or more Emacs releases. We need to provide a backward > compatibility layer, and definitely also mention this in NEWS. > This is purely internal, and we can change implementation details at will. I've added a NEWS entry, though. --001a1141fbd657cb0e054f7fd475 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Sa., 13. Mai 2017 um 19:05=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sat, 13 May 2017 16:44:08 +0200
> Cc: Philipp Stephani <phst@google.com>
>
> Instead of a lambda, create a new type containing all data required to=
> call the function, and support it in the evaluator.=C2=A0 Because this= type
> now also needs to store the function documentation, it is too big for<= br> > Lisp_Misc; use a pseudovector instead.=C2=A0 That also has the nice be= nefit
> that we don't have to add special support to the garbage collector= .

Thanks.

> +#ifdef HAVE_MODULES
> +=C2=A0 else if (MODULE_FUNCTIONP (fun))
> +=C2=A0 =C2=A0 doc =3D XMODULE_FUNCTION (fun)->documentation;
> +#endif

I wonder whether it would be cleaner to have MODULE_FUNCTIONP defined
even when HAVE_MODULES is not: it looks like it could save us quite a
few #ifdef's.

Done.
=C2= =A0

> -DEFUN ("internal--module-call", Finternal_module_call, Sint= ernal_module_call, 1, MANY, 0,
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0doc: /* Internal function to call a module= function.
> -ENVOBJ is a save pointer to a module_fun_env structure.
> -ARGLIST is a list of arguments passed to SUBRPTR.
> -usage: (module-call ENVOBJ &rest ARGLIST)=C2=A0 =C2=A0*/)
> -=C2=A0 (ptrdiff_t nargs, Lisp_Object *arglist)
> +Lisp_Object
> +funcall_module (const struct Lisp_Module_Function *const envptr,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ptrdiff_t nar= gs, Lisp_Object *arglist)
>=C2=A0 {

I don't think we can simply remove a function that was already present<= br> in one or more Emacs releases.=C2=A0 We need to provide a backward
compatibility layer, and definitely also mention this in NEWS.

This is purely internal, and we can change implemen= tation details at will. I've added a NEWS entry, though.=C2=A0
--001a1141fbd657cb0e054f7fd475--