[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Method and Generic Function internal names
- To: konstan%hermes.Berkeley.EDU@franz.com
- Subject: Method and Generic Function internal names
- From: email@example.com (Steven M. Haflich)
- Date: Sat, 12 Aug 89 23:22:39 EDT
- Cc: firstname.lastname@example.org
- In-reply-to: Joe Konstan's message of Fri, 11 Aug 89 13:18:08 -0700 <8908112018.AA14119@hermes.Berkeley.EDU>
- Redistributed: commonloops.pa
From: konstan@hermes.Berkeley.EDU (Joe Konstan)
(defun get-setf-function-name (name)
(or (gethash name *setf-function-names*)
(setf (gethash name *setf-function-names*)
(intern (let* ((pack (symbol-package name))
(pack-name (package-name pack))
(plain-name (symbol-name name))
(*package* (or pack *the-pcl-package*))
(format nil "SETF ~A::~A"
The SYMBOL-PACKAGE in you version will fail if NAME is an uninterned symbol.
Although your code probably won't name functions using gensyms, you can't safely
assume code in other loaded systems won't do it somewhere.
There are other potential problems which are unlikely to happen unless you use
"unreasonable" package or symbol names, for instance those that contain double
colons in the package or symbol name. Your function will confuse these two
because both will print as one::two::three.