GNU bug report logs - #47327
28.0.50; (cl-generic) eql specializer not evaluated

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: akater <nuclearspace@HIDDEN>; dated Mon, 22 Mar 2021 17:20:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 47327 <at> debbugs.gnu.org:


Received: (at 47327) by debbugs.gnu.org; 23 Mar 2021 23:19:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 23 19:19:21 2021
Received: from localhost ([127.0.0.1]:33390 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lOqIy-0000kb-Vn
	for submit <at> debbugs.gnu.org; Tue, 23 Mar 2021 19:19:21 -0400
Received: from mout.web.de ([212.227.15.4]:38619)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1lOqIw-0000kK-8x
 for 47327 <at> debbugs.gnu.org; Tue, 23 Mar 2021 19:19:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1616541551;
 bh=f8dYOBD5RLefjW3ucqVqmSWtIX/yDnQleqe9f3b5ygU=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To;
 b=Zrh8CzgKlpVfPHY577YvlchshqtyYhR6vE8hbQJ/PQuTjWT7po9kvJqtcnsZlfsoL
 Uz9C6Td22KzjrH90c1cTpgITtg0nQaPRx8M4pvCpRpDDPtbZAXuzWQOwdfQBOgW1y8
 QVDnjUIwB8EYjfDD151P0pHzPElanTNkuuKIszxk=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([188.98.108.176]) by smtp.web.de (mrweb005
 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Madzi-1lvR1p2X0M-00cHhH; Wed, 24
 Mar 2021 00:19:11 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: akater <nuclearspace@HIDDEN>
Subject: Re: bug#47327: 28.0.50; (cl-generic) eql specializer not evaluated
References: <87k0pz5d6u.fsf@HIDDEN>
Date: Wed, 24 Mar 2021 00:19:10 +0100
In-Reply-To: <87k0pz5d6u.fsf@HIDDEN> (akater's message of "Mon, 22 Mar 2021
 17:08:09 +0000")
Message-ID: <87v99hjw5t.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:K89dRFI6Vw6dRpQx1zQETZJnX4wCGlsrB7gV2wXW75g50AB4lyh
 fdwcpih7L7T+JdlSFeYEXdUBTGEyF+qEzZLGNX3XTg32anWGH0Bi13L0qnvzbg6UPUX0yPv
 3BLxsfUzSsob8IexVnZBMZfdlMe2St/sRPRzYj1ut/RrucuigIt8DceoTaURYYWQ6sGFpFc
 SWqGpJBefwmVckUw1i7VQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:+cx9h+Rm4rk=:Xy7RX1w4fgtQKOcGjG1jJA
 OIxcFVGWWHY6s2tGjeWjDKUkGcpDNLArUQmJWMvn/dcOOsE5C8bHnzAotluRo5ispyt3NJS7W
 hGPiuavGmQz18wVF6yZ74DaIclbCq5ztXvdORuquLxWtNm+immk4cz5ZWn5Pe6HFaBAQttoKi
 j5ub/vhLscf1dBMdT/KtxQHpqlFV78SSkpRvW8ZiiFgc18vp+DyeV3GEfNg2fVvdsEWbDMbbD
 PDZBhEldVtszrqMlSH4TIOcvqX+dcagtpGzo6+e1D5j/w7Adklc70yrtzSycAIH67fnrvBpn0
 5H0gygBt/Qv/CMSoSAhQB4qG7tu6oHGtRSsA8YOAVxB1FJGDVTeDKQflfshgpvFYAKUAJTcuq
 m1dqDkgTCgX1XGARW9wCDZ2h88rc0OlwFVmKqhXNM/wgAYAwfbsyD7VCWkLMUv/4YWy5ol//x
 dHaTQq12j9IuqB/1MGwUmIa5CN5zmlxyQYnW27ngwew8E8kiQo7fvYaeT8LSy9x+mCs/GqqJv
 wKcp0KZgHHfmH+w7sKGDEgT7U1t2e7IaEbmdF1btBgnDghwf+d9wLn1Mf4bXuixCxhi0rtMam
 /sf8R59gYp4agF49UxY5xFKDIPv5kw/VZ57fjy/FhRfBeQNvDEMr41nKWwXSjZSPDF/X19eLn
 sZxDwlOS+QqgZwh/MuK/FvOvJp/Op0Mc0hgkXTelS7pDTLMWriNGcMvlLsIocLM2W/TQJa7HG
 eD+4Bllv4RnVYJjXV4aZncTwSQRCShajOFIhCD3pV2kyLPB6xW/J9KsUOsAkpS5zcNH2WveXB
 w2L7sfCfKJ9SOT1cgD55wkdrsaIrhStRBjaDpDX32Cr6xNDrexZVdQlXQYW2UhjPrHfMQxdmg
 YkUqStUYRGdnDcMP7LRJuBzqb8yxJSKNeE03QhHBo=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 47327
Cc: 47327 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

akater <nuclearspace@HIDDEN> writes:

> In ~(eql VAL)~ specializer, ~VAL~ should evaluate during evaluation of
> the macroexpanded ~cl-defmethod~ form.

Are you sure that it should?  How is it in Common Lisp?  From the
documentation in Emacs I don't get the clear impression that what you
want is intended.  I don't say that it could not be useful, though.

Regards,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#47327; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Mar 2021 17:19:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 22 13:19:23 2021
Received: from localhost ([127.0.0.1]:58453 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lOOD5-0008K3-KA
	for submit <at> debbugs.gnu.org; Mon, 22 Mar 2021 13:19:23 -0400
Received: from lists.gnu.org ([209.51.188.17]:36310)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <nuclearspace@HIDDEN>) id 1lOOD4-0008Jv-85
 for submit <at> debbugs.gnu.org; Mon, 22 Mar 2021 13:19:22 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40664)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <nuclearspace@HIDDEN>)
 id 1lOOD2-0000WQ-H8
 for bug-gnu-emacs@HIDDEN; Mon, 22 Mar 2021 13:19:21 -0400
Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:43560)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <nuclearspace@HIDDEN>)
 id 1lOOCz-0001EQ-8D
 for bug-gnu-emacs@HIDDEN; Mon, 22 Mar 2021 13:19:19 -0400
Received: by mail-wm1-x334.google.com with SMTP id
 u5-20020a7bcb050000b029010e9316b9d5so9409529wmj.2
 for <bug-gnu-emacs@HIDDEN>; Mon, 22 Mar 2021 10:19:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version;
 bh=QX9O9d806G+bEwZbLA1VJKBVggN0R4xHpqXK7r6h5VE=;
 b=JccaBoRa4ELoqPxZXl4oSlrT7ODb8klzJc1jUzt76rdVqqTU6TOU14mZ1tmfXzJS8O
 Yjy/JljJbmK7EpSxXvOlgWmGeBk+N40yEkrlX8Z4AzQZoQBvm7n3JHbRaovE6NjC3crT
 2P6FFLf3KFyiicxfmuAUfnzNC79Q/zyKzbjoBY+8idczSZgB7/yL5Dso8Gk5IT3PMT0G
 ZdVTlii72X5TH+aZzd94rTh4aXnjgxJZlgg3Fs5UQQY6jGtOlrXbqehrVXz1JxHlCfpV
 BUabn5uVa4fw2PnFmTVFQ94+msEnT76HCBBPOOooCXb+8ofrlySZy4ewdRfd9kANh7wY
 NxSA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=QX9O9d806G+bEwZbLA1VJKBVggN0R4xHpqXK7r6h5VE=;
 b=EBoB7K6dZskshEuzUwnNywOHHtmLDXbgrfIFgmAp/kOAEkpFTvWBv59EyYdnZnJ8jl
 2cbPG/H3NpsXQH6RuwoNI+BtaPwkyEOCjD/HjKR0JLqbPFOKLWvbVdw5qS2OIQUBV5sk
 0M90RG/8L2zS+3mLihhvTfXOrsbGwe1bWkXrkxRgF9s86yTSSOi+uemot5an+kRP7Ay/
 um9km3p+bra/8YOvarJL/FlR8uUZwla4TaooYpNMisxM56Eic1OOfUd5TLbCNwQmRPhl
 AOsJfpa/sWl/WouZcDINWjuRyR4xo6zuaeNdCRx1ddIWQSnivdJy1WZ1kw2zXloF3yQv
 FXxg==
X-Gm-Message-State: AOAM5309mRzI+G3Xs5A9A611zo98TsrcWHa6QXHPqGab6kV/8v8j/7tL
 W5zql6Fw/6IS+fDWRgOpVF5yITyXeQyinQ==
X-Google-Smtp-Source: ABdhPJwvYMHUUOf5flFbfLyvDkdFCYgTa9vPT9dyBcY/QihAuJ7BLyxAnuhzGi12ZgfJCgnz2EBw6g==
X-Received: by 2002:a05:600c:22cd:: with SMTP id
 13mr105847wmg.90.1616433554888; 
 Mon, 22 Mar 2021 10:19:14 -0700 (PDT)
Received: from localhost
 (tor-exit-relay-7.anonymizing-proxy.digitalcourage.de. [185.220.102.253])
 by smtp.googlemail.com with ESMTPSA id g16sm21702738wrs.76.2021.03.22.10.19.13
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 22 Mar 2021 10:19:14 -0700 (PDT)
From: akater <nuclearspace@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; (cl-generic) eql specializer not evaluated
Date: Mon, 22 Mar 2021 17:08:09 +0000
Message-ID: <87k0pz5d6u.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
Received-SPF: pass client-ip=2a00:1450:4864:20::334;
 envelope-from=nuclearspace@HIDDEN; helo=mail-wm1-x334.google.com
X-Spam_score_int: -7
X-Spam_score: -0.8
X-Spam_bar: /
X-Spam_report: (-0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_BL_SPAMCOP_NET=1.347, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.1 (-)

--=-=-=
Content-Type: text/plain

In ~(eql VAL)~ specializer, ~VAL~ should evaluate during evaluation of
the macroexpanded ~cl-defmethod~ form.

For some reason =cl-generic.el= does not do that (it does not evaluate
the specializer form at all).  Here's a hack fix that seems to work for
me but I do not have a deep enough understanding of ~cl-generic~ to
actually suggest it:

#+begin_src emacs-lisp :results none
(cl-defmethod cl-generic-generalizers ((specializer (head cl:eql)))
  "Support for (eql VAL) specializers.
These match if the argument is `eql' to VAL."
  (let ((value (eval (cadr specializer) t)))
    (setf (car specializer) 'eql)
    (puthash value specializer cl--generic-eql-used))
  (list cl--generic-eql-generalizer))
#+end_src


Rationale:

(1) See Common Lisp HyperSpec:

#+begin_quote
The parameter specializer name ~(eql eql-specializer-form)~
indicates that the corresponding argument must be eql to the object
that is the value of ~eql-specializer-form~ for the method to be applicable.
The ~eql-specializer-form~ is evaluated
at the time that the expansion of the defmethod macro is evaluated.
#+end_quote
---
[[http://www.lispworks.com/documentation/HyperSpec/Body/m_defmet.htm][Macro
DEFMETHOD]]


(2) With eql specializer form not evaluated it does not seem possible to
e.g. use a custom method combination, even though ~cl-generic~ informs
that it is possible.  The only way I can think of, is
specializing ~cl-generic-combine-methods~ on the particular generic
function:

#+begin_src emacs-lisp :results none :eval never
(cl-defmethod cl-generic-combine-methods ((generic
                                           (cl:eql
                                            (cl--generic
                                             'my-generic-function)))
                                          methods)
  "Use `my-method-combination' method for generic function `my-generic-function'."
  (my-method-combination generic methods))
#+end_src

which is impossible if the specializer form is not evaluated.


(3) With eql specializer form not evaluated, it is only possible to
dispatch on eql numbers or eql symbols which is needlessly limited.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJLBAEBCgA1FiEEgu5SJRdnQOF34djNsr6xYbHsf0QFAmBYzvkXHG51Y2xlYXJz
cGFjZUBnbWFpbC5jb20ACgkQsr6xYbHsf0SYBhAAu+NeuL2Asu7Sz2QFjlZ/ap0z
I3jC8XfWH0u6tl3iur0q+5p8lBXHFShCllCGHphUdA2BW7/Ge0vNYhPbkWVGcSY6
KxV5G/kPsj7HyXoIrBplN9kBrUlLKnRty/0ffGvr7LCI3YstuLDoZNyVQw+g20uO
hfqNGA/WzZCwBfVrUYZncq0owLZKfk6hiN3o0lKOyoU+jLNWem8xSZ0UezrNa1Ta
/zCl2tLac/lJWRFgfwHm0Q5r01HzVu1vLsOkj/kose05aqs6AHn2f5ekM2RpT6lY
cdsC6c/m1CjZ6o2RjIJw8RjPqfx4v1ZSeqZr21KAhIP/z2K2nUYfO90vFdXFh05C
eIS1YR2rnMV2A/yxtBbIS+lo5W1PdkO7C18bhm2LF1xiy9e6mv9BJdatT8pY2F3B
wLwDrHMja1KdUI0lO1Q+wKFpQR+ugo6El+tXRzzGNd9gF/xlZvp5/kjc8aqB0XRU
zhsRHPQjRjpnjZBALyTphGP1ppxvyvU/j83FR1b7Hcy73hX/+sNf6S2Cc3ryplIZ
3aAFhKwalLwlR26W0anuWUpDqa0PkJNfugIL8KtXMZMjS+Uf4CRh/rlejrRF2fUj
RmXc+LMvDRewKqjoCKmqXJtcLNxG+wU7TqEAQz879LZzqMgUYDBJfFmqYfnpFLG1
ESUtpGXWY0SEqpV+lDs=
=WUyp
-----END PGP SIGNATURE-----
--=-=-=--




Acknowledgement sent to akater <nuclearspace@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#47327; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 23 Mar 2021 23:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.