- (existing (find-if (lambda (name)
- (and (string= value (%topic-name-value name))
- (eq type (%topic-name-type name))))
- (%topic-names topic))))
- (or existing
- (let ((name (%make-topic-name value type topic)))
- (setf (%topic-names topic) (append (%topic-names topic) (list name)))
- name))))
+ (type (canonical-topic type)))
+ (unless (eq (%topic-parent topic) (%topic-parent type))
+ (error "Name type belongs to another map."))
+ (let ((existing (find-if (lambda (name)
+ (and (string= value (%topic-name-value name))
+ (eq type (%topic-name-type name))))
+ (%topic-names topic))))
+ (or existing
+ (let ((name (%make-topic-name value type topic)))
+ (setf (%topic-names topic) (append (%topic-names topic) (list name)))
+ name)))))
+
+(defun add-default-name (topic value)
+ "Compatibility entry point for ADD-NAME with the CTM 3.11 default type."
+ (add-name topic value))