thephoeron / bit-smasher

Common Lisp library for handling bit vectors, bit vector arithmetic, and type conversions.

Home Page:https://thephoeron.github.io/bit-smasher/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Constantify *BIT-MAP*

phoe opened this issue · comments

(declaim (type (simple-array (simple-bit-vector 4) (16)) *bit-map*))
(defvar *bit-map* #(#*0000
#*0001
#*0010
#*0011
#*0100
#*0101
#*0110
#*0111
#*1000
#*1001
#*1010
#*1011
#*1100
#*1101
#*1110
#*1111))

Perhaps you could try to use ALEXANDRIA:DEFCONSTANT with :TEST #'EQUALP to turn this into a constant, in order to avoid (dynamic) variable lookup at runtime.