Function: verilog-signals-not-in

verilog-signals-not-in is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-signals-not-in IN-LIST NOT-LIST)

Documentation

Return list of signals in IN-LIST that aren't 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
;;(verilog-signals-in '(("A" "") ("B" "") ("DEL" "[2:3]")) '(("DEL" "") ("C" "")))

(defun verilog-signals-not-in (in-list not-list)
  "Return list of signals in IN-LIST that aren't 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))
	       out-list)
	   (while not-list
	     (puthash (car (car not-list)) t ht)
	     (setq not-list (cdr not-list)))
	   (while in-list
	     (when (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 (not (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)))))