Changeset 15086 for trunk/abcl/contrib/jss/invoke.lisp
- Timestamp:
- 06/17/17 06:52:37 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/contrib/jss/invoke.lisp
r15065 r15086 246 246 ,@body))))))) 247 247 248 (defvar *class-lookup-overrides*) 249 250 (defmacro with-class-lookup-disambiguated (overrides &body body) 251 "Suppose you have code that references class using the symbol 'object, and this is ambiguous. E.g. in my system java.lang.Object, org.omg.CORBA.Object. Use (with-class-lookup-disambiguated (lang.object) ...). Within dynamic scope, find-java-class first sees if any of these match, and if so uses them to lookup the class." 252 `(let ((*class-lookup-overrides* ',overrides)) 253 ,@body)) 254 255 (defun maybe-found-in-overridden (name) 256 (when (boundp '*class-lookup-overrides*) 257 (let ((found (find-if (lambda(el) (#"matches" (string el) (concatenate 'string "(?i).*" (string name) "$"))) 258 *class-lookup-overrides*))) 259 (if found 260 (let ((*class-lookup-overrides* nil)) 261 (lookup-class-name found)))))) 262 263 248 264 (defun lookup-class-name (name &key 249 265 (table *class-name-to-full-case-insensitive*) 250 266 (muffle-warning nil) 251 267 (return-ambiguous nil)) 268 (let ((overridden (maybe-found-in-overridden name))) 269 (when overridden (return-from lookup-class-name overridden))) 252 270 (setq name (string name)) 253 271 (let* (;; cant (last-name-pattern (#"compile" '|java.util.regex.Pattern| ".*?([^.]*)$"))
Note: See TracChangeset
for help on using the changeset viewer.