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

Diff of /src.lisp

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

revision 14 by rklochkov, Fri Jan 25 14:09:35 2013 UTC revision 15 by rklochkov, Sat Jan 26 19:59:30 2013 UTC
# Line 494  Replace first section of hierarchy with Line 494  Replace first section of hierarchy with
494    (defun chars-to-process ()    (defun chars-to-process ()
495      (let ((*readtable* (copy-readtable nil)))      (let ((*readtable* (copy-readtable nil)))
496        (nconc        (nconc
497         (loop :for i :from 1 :to 127         (loop :for i :from 0 :to 127
498            :for c = (code-char i)            :for c = (code-char i)
499            :when (to-process c) :collect c)            :when (to-process c) :collect c)
500         (loop :for c :across +additional-chars+         (loop :for c :across +additional-chars+
501            :when (to-process c) :collect c))))            :when (to-process c) :collect c))))
502    
503    (defun make-named-rt ()    (defun make-named-rt ()
504      `(,(cl:find-symbol "DEFREADTABLE" "NAMED-READTABLES") :advanced      `(defreadtable :advanced
505         (:merge :standard)         (:merge :standard)
506         ,@(loop :for c :in (chars-to-process)         ,@(mapcar (lambda (c) (list :macro-char c #'read-token-with-colons t))
507              :collect `(:macro-char ,c #'read-token-with-colons t))                   (chars-to-process))
508         (:macro-char #\( #'open-paren-reader nil))))         (:macro-char #\( #'open-paren-reader nil))))
509    
510  (macrolet ((def-advanced-readtable ()  (macrolet ((def-advanced-readtable ()
511               (make-named-rt)))               (make-named-rt)))
512    (when (cl:find-package "NAMED-READTABLES")    (def-advanced-readtable))
     (def-advanced-readtable)))  
513    
514  (defun activate ()  (defun activate ()
515    (dolist (c (chars-to-process))    (in-readtable :advanced))
     (set-macro-character c #'read-token-with-colons t))  
   (set-macro-character #\( #'open-paren-reader t))  
516    
517  (defun ! () (activate))  (defun ! () (activate))

Legend:
Removed from v.14  
changed lines
  Added in v.15

  ViewVC Help
Powered by ViewVC 1.1.5