[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Floating-point constant folding in Emacs byte compiler
From: |
Noam Postavsky |
Subject: |
Re: Floating-point constant folding in Emacs byte compiler |
Date: |
Mon, 2 Apr 2018 08:57:30 -0400 |
On 30 March 2018 at 12:26, Pip Cet <address@hidden> wrote:
> It's easy to fix this by merging the constvec based on eql rather than
> eq, but that makes the byte compiler inconsistent: with optimization,
> (lambda () (eq 1024.0 1024.0)) will still be false, but without
> optimization, it will turn into bytecode that always returns true.
The byte-compiler is already inconsistent in this way for string literals:
(funcall (byte-compile (lambda ()
(let ((s "one") (s2 "one"))
(eq s s2)))))
;=> t
(funcall (lambda ()
(let ((s "one") (s2 "one"))
(eq s s2))))
;=> nil
Although surprisingly:
(funcall (byte-compile (lambda ()
(eq "one" "one"))))
;=> nil
- Re: Floating-point constant folding in Emacs byte compiler, Pip Cet, 2018/04/02
- Re: Floating-point constant folding in Emacs byte compiler,
Noam Postavsky <=
- Re: Floating-point constant folding in Emacs byte compiler, Eli Zaretskii, 2018/04/02
- RE: Floating-point constant folding in Emacs byte compiler, Drew Adams, 2018/04/02
- Re: Floating-point constant folding in Emacs byte compiler, Eli Zaretskii, 2018/04/02
- Re: Floating-point constant folding in Emacs byte compiler, Pip Cet, 2018/04/02
- RE: Floating-point constant folding in Emacs byte compiler, Drew Adams, 2018/04/02
- Re: Floating-point constant folding in Emacs byte compiler, Stefan Monnier, 2018/04/02
- Re: Floating-point constant folding in Emacs byte compiler, Paul Eggert, 2018/04/02
- Re: Floating-point constant folding in Emacs byte compiler, Pip Cet, 2018/04/02
- Re: Floating-point constant folding in Emacs byte compiler, Eli Zaretskii, 2018/04/02
- Re: Floating-point constant folding in Emacs byte compiler, Pip Cet, 2018/04/02