next up previous contents index
Next: Controlling the Evaluation of Up: Program Interface Previous: Transformers

With-SNePSUL Reader Macro

  The with-snepsul reader macro is provided so that users can easily incorporate calls to SNePSUL commands within Lisp code.

(#[i]! (snepsul-formtex2html_wrap_inline4687 snepsul-formtex2html_wrap_inline4615))  The form following #[i]! is taken to be a list of SNePSUL forms, each of which will be executed just as if it had been typed that way at the SNePS prompt, regardless of the package in which the #[i]! form is read. References to Lisp variables can be made via a ~ reader macro mechanism (similar to the comma within backquote syntax). Results of ~ expansions will be automatically interned into the SNePSUL package (i.e., any symbols that might be part of such a result), unless explicitly specified otherwise. All the special reader syntax available at the SNePS top-level is available, too.

The semantics of the ~ syntax is:
~ s-expression:
S-expression will be read with ordinary reader syntax and at execution time it will be evaluated and its value inserted into the SNePSUL expression. If the value is a symbol or a list containing symbols then these symbols will be interned into the SNePSUL package first.
Ex: #!((describe ~'(m1 m2))) will act like (describe (m1 m2)).
~@ s-expression:
Just like ~ but the value of the s-expression has to be a list which will be spliced into the SNePSUL expression. Any symbols occuring as leaves in the list will be interned into the SNePSUL package first. Ex: #!((describe ~@'(m1 m2))) will act like (describe m1 m2).
~~ s-expression:
Just like ~ but symbols in the value will not be interned into the SNePSUL package.
~~@ s-expression:
Just like ~@ but symbols in the value will not be interned into the SNePSUL package.

CAUTION: The ~ syntax can only be used within SNePSUL forms, but not to denote multiple forms, e.g., while #!(~com1 ~com2 ~com3) is legal (as long as the runtime values of comtex2html_wrap_inline4695 represent proper SNePSUL commands), #!(~@commands) is not!!

Supplying an optional digit argument can be used to select a specific evaluation function, or to suppress output:
tabular1156
For example, #4!((build relation node)) will use the function eval to evaluate the form (hence build can be used!!), and will suppress any output generated by the snepsul command.




next up previous contents index
Next: Controlling the Evaluation of Up: Program Interface Previous: Transformers

John Francis Santore
Fri May 14 11:18:57 EDT 1999