Function: [ reader

Documentation

Read a form using YACLML's [ syntax. Everything between the #[ and the #] is read as text. ~FORM prints (using <:as-html) the value returned by FORM while $FORM simply evaluates FORM and ignore the result.

Source

(defun |[ reader| (stream char)
  "Read a form using YACLML's [ syntax.

Everything between the #\[ and the #\] is read as text. ~FORM
prints (using <:as-html) the value returned by FORM while $FORM
simply evaluates FORM and ignore the result."
  (declare (ignore char))
  (with-collector (forms)
    (loop
       for char = (read-char stream t nil t)
       do (case char
            (#\\ (forms (read-char stream t nil t)))
            (#\] (return-from |[ reader| `(yaclml-quote ,@(forms))))
            (#\$ (forms (read stream t nil t)))
            (#\~ (forms `(<:as-html ,(read stream t nil t))))
            (t (forms char))))))
Source Context