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

Diff of /src.lisp

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

revision 9 by rklochkov, Sun Dec 23 10:43:24 2012 UTC revision 10 by rklochkov, Sun Dec 30 14:24:44 2012 UTC
# Line 160  RETURN: number of the colons" Line 160  RETURN: number of the colons"
160    
161  (defun read-after-colon (stream maybe-package colons)  (defun read-after-colon (stream maybe-package colons)
162    "Read symbol package:sym or list package:(...)"    "Read symbol package:sym or list package:(...)"
163      (declare (type symbol maybe-package)
164               (type stream stream)
165               (type fixnum colons))
166    (when (= colons 0) ; no colon: this is a symbol or an atom    (when (= colons 0) ; no colon: this is a symbol or an atom
167      (return-from read-after-colon      (return-from read-after-colon
168        (if (symbolp maybe-package)        (if (symbolp maybe-package)
169            (let ((name (symbol-name maybe-package)))            (prog1
170              (or (find-symbol name) (intern name)))                (let ((name (symbol-name maybe-package)))
171                    (or (find-symbol name) (intern name)))
172                (unintern maybe-package))
173            maybe-package)))            maybe-package)))
174    
175    (let ((package (find-package maybe-package)))    (let ((package (find-package maybe-package)))
# Line 286  So, if you make Line 291  So, if you make
291  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.
292  "  "
293    (%set-handler (package-finders package) `(:prefix ,prefix) name    (%set-handler (package-finders package) `(:prefix ,prefix) name
294      (cl:find-package (concatenate 'string prefix "." name))))      (cl:find-package (concatenate 'string (string prefix) "." name))))
295    
296  (defun push-local-nickname (long-package nick  (defun push-local-nickname (long-package nick
297                              &optional (current-package *package*))                              &optional (current-package *package*))
# Line 408  For example, this will be error: Line 413  For example, this will be error:
413                                       t *advanced-readtable*))))))                                       t *advanced-readtable*))))))
414    
415        (set-syntax-from-char #\: #\Space *colon-readtable* *colon-readtable*)        (set-syntax-from-char #\: #\Space *colon-readtable* *colon-readtable*)
416        (set-macro-character #\( #'open-paren-reader))        (set-macro-character #\( #'open-paren-reader nil *advanced-readtable*))
417      (setf *readtable* *advanced-readtable*)))      (setf *readtable* *advanced-readtable*)))
418    
419  (defun ! () (activate))  (defun ! () (activate))

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.5