From: Mark Wooding Date: Sun, 26 Mar 2017 14:16:18 +0000 (+0100) Subject: src/class-utilities.lisp: Permit `temporary-name' objects as class names. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/a547121fd73f150141cdb91636d37b21093f9d27 src/class-utilities.lisp: Permit `temporary-name' objects as class names. This will be helpful in error recovery. Classes and various related objects must have names, but if we can't parse the user's choice of name then we have to make one up. The easy approach, to avoid conflicts with the user's other choices, is to pick a name with funny characters in, but that's properly rejected by the check here; but we can wrap the name up in a `temporary-name' object to push it through without trouble. --- diff --git a/src/class-utilities.lisp b/src/class-utilities.lisp index 5b3021f..a26afd2 100644 --- a/src/class-utilities.lisp +++ b/src/class-utilities.lisp @@ -173,11 +173,12 @@ (defun valid-name-p (name) * all of whose characters are alphanumeric or underscores * and which doesn't contain two consecutive underscores." - (and (stringp name) - (plusp (length name)) - (alpha-char-p (char name 0)) - (every (lambda (ch) (or (alphanumericp ch) (char= ch #\_))) name) - (not (search "__" name)))) + (or (typep name 'temporary-variable) + (and (stringp name) + (plusp (length name)) + (alpha-char-p (char name 0)) + (every (lambda (ch) (or (alphanumericp ch) (char= ch #\_))) name) + (not (search "__" name))))) (export 'find-root-superclass) (defun find-root-superclass (class)