diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..6aec41f --- /dev/null +++ b/README.md | |||
@@ -0,0 +1,35 @@ | |||
1 | # CHICKEN-SCRATCH --- heredocs for CHICKEN | ||
2 | |||
3 | written by Case Duckworth <acdw@acdw.net> off an idea by evhan | ||
4 | |||
5 | Licensed under BSD-3. See COPYING for details. | ||
6 | |||
7 | CHICKEN has "[Multiline string constants with embedded expressions][multiline]" | ||
8 | syntax, which is basically shell here-doc syntax but schemier and with a real | ||
9 | programming langugage to embed. evhan's [beaker tool][beaker] (which is great, | ||
10 | btw) uses this facility to do a quick-and-dirty templating for wiki generation. | ||
11 | I realized that I could use the same facility for the same kind of heredoc-style | ||
12 | templating I have done in various other SSGs like [unk][] and [vienna][], but | ||
13 | with scheme. Thus, CHICKEN-SCRATCH was born. | ||
14 | |||
15 | [multiline]: http://wiki.call-cc.org/man/5/Extensions%20to%20the%20standard#multiline-string-constant-with-embedded-expressions | ||
16 | [beaker]: https://git.sr.ht/~evhan/beaker | ||
17 | [unk]: https://git.acdw.net/unk/ | ||
18 | [vienna]: https://git.acdw.net/vienna/ | ||
19 | |||
20 | ## Usage | ||
21 | |||
22 | `expand-string` is the main entry point to this module. It takes a string and | ||
23 | returns a string with all `#( ... )` forms expanded according to the CHICKEN | ||
24 | rules. `expand-port` is a port version of `expand-string`. | ||
25 | |||
26 | To enable truly invisible definitions within the expanded string, the `def` | ||
27 | macro is provided which performs a `set!` on its variables, then returns a | ||
28 | string guaranteed not to be in the input string, which is then filtered out | ||
29 | in the expanded string. | ||
30 | |||
31 | Finally, to enable CHICKEN-SCRATCH to be used in a shebang, if the first line | ||
32 | of the input string begins with `#!`, it's deleted from the input. | ||
33 | |||
34 | ## Installation | ||
35 | |||