/[advanced-readtable]/README.md
ViewVC logotype

Diff of /README.md

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

revision 17 by rklochkov, Sat Jan 26 20:28:43 2013 UTC revision 18 by rklochkov, Sun Jan 27 10:14:58 2013 UTC
# Line 113  For example, this will be error: Line 113  For example, this will be error:
113    
114  Be careful: this change is not local to your package.  Be careful: this change is not local to your package.
115    
116  _set-macro-symbol_ - syntax is like set-macro-character,  _set-macro-symbol_ symbol func -- sets FUNC to process the SYMBOL.
117  ------------------  --------------------------
118    FUNC will get stream of reader and the symbol (see set-macro-character).
119  But FUNC is binded to SYMBOL, not character. This symbol will be processed  
120  in all cases, where it is not bounded by ||.  To prevent symbol from processing (for example in set-macro-symbol construction) you should enclose it in bars.
121    
122    This construction will set 'foo as an alias to 'long-package-name:long-name:
123    
124        (set-macro-symbol '|FOO|
125          (lambda (stream symbol)
126             (declare (ignore stream symbol))
127                'long-package-name:long-name))
128    
129    Another way to prevent symbol processing is setting `advanced-readtable:*enable-symbol-readmacro*` to nil.
130    Remember, that symbol processing is done during reading the file, so, if you need to temporarily disable
131    `*enable-symbol-readmacro*`, then enclose it in #.
132    
133  Now you may make something like  Now you may make something like
134    
# Line 126  Now you may make something like Line 137  Now you may make something like
137  html:[ and sql:[ will have different handlers and you may mix them in  html:[ and sql:[ will have different handlers and you may mix them in
138  one expression.  one expression.
139    
 Also it allows to make simple symbol-aliases. For example:  
   
     (set-macro-symbol '|ALIAS| (lambda (stream symbol)  
                                  (declare (ignore stream symbol))  
                                    'advanced-readtables:push-local-package))  
 Now you may do  
   
     (alias 'iter:iter :iterate)  
   
140  Moreover, you may alias variables from other packages and set them through  Moreover, you may alias variables from other packages and set them through
141  alias. But be careful: this change is not local to your package.  alias. But be careful: this change is not local to your package. If you write qualified name
142    of the symbol, you should enclose package-name int bars:
143        (set-macro-symbol '|OTHER-PACKAGE|:foo
144          (lambda (stream symbol)
145             (declare (ignore stream symbol))
146                'long-package-name:long-name))
147    
148    
149  _get-macro-symbol_ - syntax is like get-macro-character,  _get-macro-symbol_ - syntax is like get-macro-character,

Legend:
Removed from v.17  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.5