unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Noam Postavsky <npostavs@gmail.com>
Cc: Stefan Kangas <stefan@marxist.se>,
	40968@debbugs.gnu.org, Pip Cet <pipcet@gmail.com>
Subject: bug#40968: 28.0.50; (apply nil)
Date: Thu, 7 May 2020 15:53:42 +0200	[thread overview]
Message-ID: <6ADF0807-7EBD-4054-8579-4D9AD3065D51@acm.org> (raw)
In-Reply-To: <874kssm04d.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

7 maj 2020 kl. 13.54 skrev Noam Postavsky <npostavs@gmail.com>:

> The obvious solution is just to leave the weird single arg form
> unoptimized.  Otherwise, what about your earlier suggestion?
> 
>    (apply X) == (apply (car X) (cdr X))

Yes, we are under no obligation to optimise this case in any way.

> By the way, bytecomp-check-1 already ignores differences between error
> types.  So the test case doesn't need a condition-case at all if we
> don't care about which particular error is signalled.

It seems to treat all errors as producing the value nil, but that should of course be fixed.


[-- Attachment #2: bytecomp-tests.diff --]
[-- Type: application/octet-stream, Size: 2470 bytes --]

diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index bfe2d06a61..c235dd43fc 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -363,10 +363,10 @@ bytecomp-check-1
 	(byte-compile-warnings nil)
 	(v0 (condition-case nil
 		(eval pat)
-	      (error nil)))
+	      (error 'bytecomp-check-error)))
 	(v1 (condition-case nil
 		(funcall (byte-compile (list 'lambda nil pat)))
-	      (error nil))))
+	      (error 'bytecomp-check-error))))
     (equal v0 v1)))
 
 (put 'bytecomp-check-1 'ert-explainer 'bytecomp-explain-1)
@@ -374,10 +374,10 @@ bytecomp-check-1
 (defun bytecomp-explain-1 (pat)
   (let ((v0 (condition-case nil
 		(eval pat)
-	      (error nil)))
+	      (error 'bytecomp-check-error)))
 	(v1 (condition-case nil
 		(funcall (byte-compile (list 'lambda nil pat)))
-	      (error nil))))
+	      (error 'bytecomp-check-error))))
     (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled."
 	    pat v0 v1)))
 
@@ -402,10 +402,10 @@ test-byte-opt-arithmetic
     (dolist (pat byte-opt-testsuite-arith-data)
       (condition-case nil
 	  (setq v0 (eval pat))
-	(error (setq v0 nil)))
+	(error (setq v0 'bytecomp-check-error)))
       (condition-case nil
 	  (setq v1 (funcall (byte-compile (list 'lambda nil pat))))
-	(error (setq v1 nil)))
+	(error (setq v1 'bytecomp-check-error)))
       (insert (format "%s" pat))
       (indent-to-column 65)
       (if (equal v0 v1)
@@ -561,11 +561,11 @@ bytecomp-lexbind-check-1
 	(byte-compile-warnings nil)
 	(v0 (condition-case nil
 		(eval pat t)
-	      (error nil)))
+	      (error 'bytecomp-check-error)))
 	(v1 (condition-case nil
 		(funcall (let ((lexical-binding t))
                            (byte-compile `(lambda nil ,pat))))
-	      (error nil))))
+	      (error 'bytecomp-check-error))))
     (equal v0 v1)))
 
 (put 'bytecomp-lexbind-check-1 'ert-explainer 'bytecomp-lexbind-explain-1)
@@ -573,11 +573,11 @@ bytecomp-lexbind-check-1
 (defun bytecomp-lexbind-explain-1 (pat)
   (let ((v0 (condition-case nil
 		(eval pat t)
-	      (error nil)))
+	      (error 'bytecomp-check-error)))
 	(v1 (condition-case nil
 		(funcall (let ((lexical-binding t))
                            (byte-compile (list 'lambda nil pat))))
-	      (error nil))))
+	      (error 'bytecomp-check-error))))
     (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled."
 	    pat v0 v1)))
 

  parent reply	other threads:[~2020-05-07 13:53 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 18:26 bug#40968: 28.0.50; (apply nil) Pip Cet
2020-04-29 18:35 ` Pip Cet
2020-05-06  1:51 ` Stefan Kangas
2020-05-06  7:26   ` Pip Cet
2020-05-06 11:24     ` Stefan Kangas
2020-05-06 11:49       ` Pip Cet
2020-05-06 13:02         ` Stefan Kangas
2020-05-06 13:55           ` Pip Cet
2020-05-06 15:28             ` Stefan Kangas
2020-05-06 18:06               ` Pip Cet
2020-05-06 19:26                 ` Drew Adams
2020-05-06 14:03           ` Eli Zaretskii
2020-05-06 17:54             ` Pip Cet
2020-05-06 18:09               ` Eli Zaretskii
2020-05-06 18:00           ` Drew Adams
2020-05-06 18:28             ` Noam Postavsky
2020-05-06 19:17               ` Drew Adams
2020-05-06 19:21                 ` Pip Cet
2020-05-06 19:28                   ` Drew Adams
2020-05-07  2:27                     ` Eli Zaretskii
2020-05-06 17:46         ` Drew Adams
2020-05-06 20:32         ` Phil Sainty
2020-05-06 21:35           ` Drew Adams
2020-09-29  3:00     ` Stefan Monnier
2020-05-06 10:18 ` Mattias Engdegård
2020-05-06 10:45   ` Eli Zaretskii
2020-05-06 10:57     ` Andreas Schwab
2020-05-06 11:25   ` Pip Cet
2020-05-06 11:49     ` Mattias Engdegård
2020-05-06 18:42 ` Mattias Engdegård
2020-05-07  6:53   ` Pip Cet
2020-05-07  9:11     ` Mattias Engdegård
2020-05-07 11:54       ` Noam Postavsky
2020-05-07 11:58         ` Pip Cet
2020-05-07 12:20           ` Noam Postavsky
2020-05-07 13:53         ` Mattias Engdegård [this message]
2020-06-02  7:36           ` Pip Cet
2020-06-02 16:32             ` Drew Adams
2020-06-02 16:43               ` Eli Zaretskii
2020-06-02 16:36             ` Eli Zaretskii
2020-09-27 15:01             ` Lars Ingebrigtsen
2020-09-27 19:28               ` Drew Adams
     [not found] <<CC40D602-5027-40A7-9BAB-1AADC9E4BDAE@acm.org>
     [not found] ` <<CAOqdjBfj6AExvem5WWLfMiw4fEsY-xUUmosV+fj9CaPgWM16ag@mail.gmail.com>
     [not found]   ` <<ECEC9424-919F-4364-9294-381C8751921A@acm.org>
     [not found]     ` <<874kssm04d.fsf@gmail.com>
     [not found]       ` <<6ADF0807-7EBD-4054-8579-4D9AD3065D51@acm.org>
     [not found]         ` <<CAOqdjBdQne3RFTjg4hej40L5aeBx6vbGp6nXKx2TwPkLPf5NPw@mail.gmail.com>
     [not found]           ` <<fabfb1fd-4da1-4e72-90c9-333532011a48@default>
     [not found]             ` <<83pnahctad.fsf@gnu.org>
2020-06-02 17:10               ` Drew Adams
2020-06-02 18:41                 ` Pip Cet

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=6ADF0807-7EBD-4054-8579-4D9AD3065D51@acm.org \
    --to=mattiase@acm.org \
    --cc=40968@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --cc=pipcet@gmail.com \
    --cc=stefan@marxist.se \
    /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).