Now I use the SWIG defanonenum:
to define my constants. I usually define like this with the + signs on either end:
The only caveat is that the speed would closely match what I have now. A billion runs of +char-max+
takes 0.404 seconds of real time in my current setup. Thank you in advance for any guidance on this:)
(defmacro defanonenum (&body enums)
"Converts anonymous enums to Lisp constants."
`(cl:progn ,@(cl:loop for value in enums
for index = 0 then (cl:1+ index)
when (cl:listp value)
do (cl:setf index (cl:second value)
value (cl:first value))
collect `(cl:defconstant ,value ,index))))
to define my constants. I usually define like this with the + signs on either end:
(defanonenum
(+char-max+ 127))
I would like to have constants that are keywords so instead of +char-max+ it would be :char-max.The only caveat is that the speed would closely match what I have now. A billion runs of +char-max+
takes 0.404 seconds of real time in my current setup. Thank you in advance for any guidance on this:)