From f602f062c462770a7141bab34f0912eb693f330e Mon Sep 17 00:00:00 2001 From: cynic Date: Tue, 4 Oct 2022 11:43:19 -0400 Subject: [PATCH] add preprocessor guide to readme --- readme.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/readme.txt b/readme.txt index 1d162d9..bbee5f8 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,9 @@ this language belongs to makise kurisu. there are many like it, but this one is hers. +the interpreter is currently written in python 3. when I feel comfortable with the +implemented features, a "real" spec will be frozen and I will make a native one. +this implementation does not rely on any modules or libraries outside of the python +standard library. syntax: @@ -14,6 +18,14 @@ lists starting with defined function identifiers are executed with the rest of t as parameters, i.e. (spit "hello~" (+ 9000 1)). runs `spit` using "hello" and (+ 9000 1). the lower-order function is calculated for the higher-order one, so it ends up calling `spit` with "hello" and 9001. +there are also pre-processor macros: +- INCLUDE:, for expanding and inserting another file +- DEFINE::macro:::, for defining macros +- :::, for expanding macros +- :, for adding comments (lines removed in pre-processing) +you may notice that the language looks like a lisp/scheme and the preprocessor keywords +are similar to m4/cpp. I'm a fan of homoiconicity, and this provides both a familiar and +a delightfully simple syntax. examples: