[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [NonGNU ELPA] New package: latex-table-wizard
From: |
Philip Kaludercic |
Subject: |
Re: [NonGNU ELPA] New package: latex-table-wizard |
Date: |
Sat, 17 Dec 2022 14:17:53 +0000 |
Philip Kaludercic <philipk@posteo.net> writes:
> +;; Why not use `memq'?
> (defmacro latex-table-wizard--or (symbol &rest values)
> "Return non-nil if SYMBOL is `eq' to one of VALUES."
> (let ((bools (mapcar (lambda (value) `(eq ,symbol ,value))
To argue out this point, compare:
(disassemble (byte-compile '(or (eq foo 'a) (eq foo 'b) (eq foo 'c))))
--8<---------------cut here---------------start------------->8---
byte code:
args: nil
0 varref foo
1 constant a
2 eq
3 goto-if-not-nil-else-pop 1
6 varref foo
7 constant b
8 eq
9 goto-if-not-nil-else-pop 1
12 varref foo
13 constant c
14 eq
15:1 return
--8<---------------cut here---------------end--------------->8---
and:
(disassemble (byte-compile '(memq foo '(a b c))))
--8<---------------cut here---------------start------------->8---
byte code:
args: nil
0 varref foo
1 constant (a b c)
2 memq
3 return
--8<---------------cut here---------------end--------------->8---
Re: [NonGNU ELPA] New package: latex-table-wizard,
Philip Kaludercic <=