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

Diff of /src.lisp

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

revision 7 by rklochkov, Sun Dec 9 05:48:36 2012 UTC revision 8 by rklochkov, Sun Dec 9 09:12:39 2012 UTC
# Line 245  RETURN: number of the colons" Line 245  RETURN: number of the colons"
245  (defmacro set-handler (handler-list key function)  (defmacro set-handler (handler-list key function)
246    (let ((key-var (gensym "key")))    (let ((key-var (gensym "key")))
247      `(let ((,key-var ,key))      `(let ((,key-var ,key))
248         (unless (assoc ,key-var ,handler-list)         (unless (assoc ,key-var ,handler-list :test #'equal)
249           (push (cons ,key-var ,function)           (push (cons ,key-var ,function)
250                 ,handler-list)))))                 ,handler-list)))))
251    
# Line 272  So, if you make Line 272  So, if you make
272    
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) `(:prefix ,prefix) name
276      (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
# Line 294  rename LIB version 1 to LIB1 and make Line 294  rename LIB version 1 to LIB1 and make
294   (push-local-nickname :lib1 :lib :a)   (push-local-nickname :lib1 :lib :a)
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) `(: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)
# Line 311  For example, this will be error: Line 311  For example, this will be error:
311  , because first for is in ITERATE package, but second -- is not.  , because first for is in ITERATE package, but second -- is not.
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) `(:local ,symbol ,local-package) 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    

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

  ViewVC Help
Powered by ViewVC 1.1.5