aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-08-15 07:03:06 -0700
committercolin <colin@cicadas.surf>2023-08-15 07:03:06 -0700
commit7b1d813fe7f020d7df52a22f3a8f288b7913dc9b (patch)
tree78da53a6a597277898ec44380a52ca821a6af4da
parentc4897d65934b702d46b773cd497e865e18615afa (diff)
Readme update, macroexpand example
-rw-r--r--README.org14
1 files changed, 14 insertions, 0 deletions
diff --git a/README.org b/README.org
index 0b08ad0..1c41957 100644
--- a/README.org
+++ b/README.org
@@ -58,6 +58,20 @@ This defines a calculator language that you can use like so:
#+end_src
+Calling our trusty ~MACROEXPAND-1~ on a ~calc~ expression shows that
+it just expands out into regular lisp:
+
+#+begin_src lisp
+
+> (macroexpand-1 '(calc 4 * (2 + -4) * sin(1.5)))
+(* (* 4 (+ 2 -4)) (SIN 1.5))
+
+> (macroexpand-1 '(calc 4 * 2 + -4 * sin(1.5)))
+(+ (* 4 2) (* -4 (SIN 1.5)))
+
+#+end_src
+
+
The symbol ~calc~ also has a function docstring. If you are using
[[HTTPS://slime.common-lisp.dev/][SLIME]], you can evoke ~M-x slime-documentation~ with your cursor over
the ~calc~ symbol to see this: