After the first execution, the routine is rewritten with the dotted pair already constructed. From there, assoc from a list is a lot faster than stepping through it with vl-remove-if-not. Am I close?
Seems really clever, I would have just done it this way...
(defun foo (v)
(if (and (numberp v) (<= 0 (setq v (fix v)) 14))
(substr (vl-symbol-name
(car (vl-remove-if-not
(function (lambda (e) (eq v (eval e))))
'(acAlignmentLeft acAlignmentCenter acAlignmentRight acAlignmentAligned
acAlignmentMiddle acAlignmentFit acAlignmentTopLeft acAlignmentTopCenter
acAlignmentTopRight acAlignmentMiddleLeft acAlignmentMiddleCenter
acAlignmentMiddleRight acAlignmentBottomLeft acAlignmentBottomCenter
acAlignmentBottomRight
)
)
)
)
12
)
)
)
... but I'm dumb.
Cool stuff, gives me a lot to think about.