CL-RTTEMPLATE

The cl-rttemplate is a read-time quotation system. Published in the public domain. It's a template system similar to the quasiquote & unquote facility, however, it operates during the read-time.

I've created this for a need to macroize the commonqt reader macros.

Download

The asdf-installable package: cl-rttemplate.tar.gz

API

Usage

Enable the syntax by (cl-rttemplate:enable-syntax) or (rtt:enable-syntax).

Modify the readtable at yout will, for example: (setf (readtable-case rtt:*rt*) :preserve).

Samples

Simple symbol building:

#"'begin"(expt 3 8)"end"#

The lexical binding is available + an exhibition of the impact of *rt*:

(let ((outer-value '|Hello|))
   #"'(a b " outer-value " \"" outer-value " world!\")"#)

vs.

(setf (readtable-case rtt:*rt*) :preserve)
(let ((outer-value '|Hello|))
   #"'(a b " outer-value " \"" outer-value " world!\")"#)

An example with #@:

#"'(a " #@'(b c d) " e)"#

and:

#"(* " #0@(floor 100 7) " " #1@(floor 25 13) ")"#