From d47e5bdb0b319730475008b9f908d0307acb531c Mon Sep 17 00:00:00 2001 From: mcdearman Date: Sat, 8 Jun 2024 22:19:14 -0500 Subject: [PATCH] update --- examples/mvp.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/mvp.scm b/examples/mvp.scm index a623b69..4a413e4 100644 --- a/examples/mvp.scm +++ b/examples/mvp.scm @@ -136,6 +136,15 @@ (#t ,then) (#f ,else))) +;; Reader macros are rules for transforming terms at read time. +;; They are used to define new syntax and to optimize code. +;; The most common reader macro is the quote reader macro. +;; Quote can be defined as a reader macro using the `reader` special form +;; and template matching. +(reader-macro (quote stream) + (match stream + ("'{term}" `(quote term)))) + ;; module declarations (module Vector (def (new) {:data []})