Allow names to start with underscore

This commit is contained in:
John Lorentzson 2025-07-08 13:41:16 +02:00
parent 09dc731444
commit 857fa43df0

View file

@ -29,7 +29,8 @@ reading immediately. Should be a subset of *SPECIAL-TOKEN-CHARS*.")
(defun valid-name-p (string)
(assert (stringp string))
(and (not (zerop (length string)))
(alpha-char-p (char string 0))
(or (alpha-char-p (char string 0))
(char= (char string 0) #\_))
(loop :for char :across (subseq string 1)
:always (or (alphanumericp char)
(char= char #\_)))))