Function: verilog-signals-in
verilog-signals-in is a byte-compiled function defined in
verilog-mode.el.gz.
Signature
(verilog-signals-in IN-LIST NOT-LIST)
Documentation
Return list of signals in IN-LIST that are also in NOT-LIST.
Also remove any duplicates in IN-LIST. Signals must be in standard (base vector) form.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-signals-in (in-list not-list)
"Return list of signals in IN-LIST that are also in NOT-LIST.
Also remove any duplicates in IN-LIST.
Signals must be in standard (base vector) form."
;; This function is hot, so implemented as O(1)
(cond ((eval-when-compile (fboundp 'make-hash-table))
(let ((ht (make-hash-table :test 'equal :rehash-size 4.0))
(ht-not (make-hash-table :test 'equal :rehash-size 4.0))
out-list)
(while not-list
(puthash (car (car not-list)) t ht-not)
(setq not-list (cdr not-list)))
(while in-list
(when (and (gethash (verilog-sig-name (car in-list)) ht-not)
(not (gethash (verilog-sig-name (car in-list)) ht)))
(setq out-list (cons (car in-list) out-list))
(puthash (verilog-sig-name (car in-list)) t ht))
(setq in-list (cdr in-list)))
(nreverse out-list)))
;; Slower Fallback if no hash tables (pre Emacs 21.1/XEmacs 21.4)
(t
(let (out-list)
(while in-list
(if (and (assoc (verilog-sig-name (car in-list)) not-list)
(not (assoc (verilog-sig-name (car in-list)) out-list)))
(setq out-list (cons (car in-list) out-list)))
(setq in-list (cdr in-list)))
(nreverse out-list)))))