/[advanced-readtable]/src.lisp
ViewVC logotype

Diff of /src.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6 by rklochkov, Sun Dec 9 05:47:35 2012 UTC revision 7 by rklochkov, Sun Dec 9 05:48:36 2012 UTC
# Line 251  RETURN: number of the colons" Line 251  RETURN: number of the colons"
251    
252  (defmacro %set-handler (handler-list key name &body handler-body)  (defmacro %set-handler (handler-list key name &body handler-body)
253    "Local macros for push-* functions. No gensyms intended."    "Local macros for push-* functions. No gensyms intended."
254    (set-handler ,handler-list ,key    `(set-handler ,handler-list ,key
255                 (lambda (,name package)                  (lambda (,name package)
256                   (declare (ignore package)) . ,handler-body)))                    (declare (ignore package)) . ,handler-body)))
257    
258  (defun push-import-prefix (prefix &optional (package *package*))  (defun push-import-prefix (prefix &optional (package *package*))
259    "Enables using package name omitting prefix.    "Enables using package name omitting prefix.
# Line 273  So, if you make Line 273  So, if you make
273  after that reducers:... will refer to new package, not com.clearly-useful.reducers.  after that reducers:... will refer to new package, not com.clearly-useful.reducers.
274  "  "
275    (%set-handler (package-finders package) (list :prefix prefix) name    (%set-handler (package-finders package) (list :prefix prefix) name
276      (or (cl:find-package name)      (cl:find-package (concatenate 'string prefix "." name))))
         (cl:find-package (concatenate 'string prefix "." name)))))  
277    
278  (defun push-local-nickname (long-package nick  (defun push-local-nickname (long-package nick
279                              &optional (current-package *package*))                              &optional (current-package *package*))
# Line 296  rename LIB version 1 to LIB1 and make Line 295  rename LIB version 1 to LIB1 and make
295  "  "
296    (let ((dpackage (find-package long-package)))    (let ((dpackage (find-package long-package)))
297      (%set-handler (package-finders current-package) (list :nick long-package nick) name      (%set-handler (package-finders current-package) (list :nick long-package nick) name
298         (when (string= name (string nick)) dpackage))))        (when (string= name (string nick)) dpackage))))
299    
300  (defun push-local-package (symbol local-package)  (defun push-local-package (symbol local-package)
301    "Sets local-package for a symbol. Many macroses use there own clauses.    "Sets local-package for a symbol. Many macroses use there own clauses.
# Line 313  For example, this will be error: Line 312  For example, this will be error:
312  "  "
313    (let ((dpackage (find-package local-package)))    (let ((dpackage (find-package local-package)))
314      (%set-handler (extra-finders symbol) (list :nick long-package nick) name      (%set-handler (extra-finders symbol) (list :nick long-package nick) name
315         (multiple-value-bind (symbol status) (cl:find-symbol name dpackage)        (multiple-value-bind (symbol status) (cl:find-symbol name dpackage)
316           (when (eq status :external) symbol)))))          (when (eq status :external) symbol)))))
317    
318  ;;;  ;;;
319  ;;; Readtable analysis and change  ;;; Readtable analysis and change

Legend:
Removed from v.6  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.5