emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add n


From: Tino Calancha
Subject: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.]
Date: Thu, 23 Feb 2017 13:35:54 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)


Sorry if this is obvious, then just ignore.

I have a custom lib using `pcase' somewhere.  That lib is
compatible with Emacs25.
Usually i compile this lib against the master branch.  Then, i load
that very same resulting .elc in Emacs-25 and runs same as in Emacs-26.
(Maybe this is just wrong and i must keep separated .elc)

After the new bytecode those parts of the lib using pcase fail.
For instance, put the following in a file:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun test-case ()
  (let ((val "foo"))
    (pcase val
      ("foo" "foo")
      ("bar" "bar")
      (_ (error "Neither 'foo' nor 'bar'")))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I) Compile under master branch.
II) Load the resultant .elc with Emacs-25
II) M-: (test-case)
;; Signal error: Invalid byte opcode: op=183, ptr=4

So, in conclusion:
From now on, we need to keep two separated .elc in such custom libs,
right?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]