diff options
author | Arne Babenhauserheide <arne_bab@web.de> | 2024-03-11 06:34:52 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-06-01 11:50:16 +0200 |
commit | dce65edbaf55ce8ead6c9b100b6f4059b09e0ffc (patch) | |
tree | 64da64bc594bd242266f083ab19381c4f416712d /doc/ref/srfi-modules.texi | |
parent | 7b92b22899a104039e232eaf2030e20e47ca1a07 (diff) | |
download | guile-dce65edbaf55ce8ead6c9b100b6f4059b09e0ffc.tar.gz |
Add language/wisp, Wisp tests, and SRFI-119 documentation
* doc/ref/srfi-modules.texi (srfi-119): add node
* module/language/wisp.scm: New file.
* module/language/wisp/spec.scm: New file.
* test-suite/tests/srfi-119.test: New file.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/ref/srfi-modules.texi')
-rw-r--r-- | doc/ref/srfi-modules.texi | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi index efb9ccca4..02da3e2f2 100644 --- a/doc/ref/srfi-modules.texi +++ b/doc/ref/srfi-modules.texi @@ -64,6 +64,7 @@ get the relevant SRFI documents from the SRFI home page * SRFI-98:: Accessing environment variables. * SRFI-105:: Curly-infix expressions. * SRFI-111:: Boxes. +* SRFI-119:: Wisp: simpler indentation-sensitive Scheme. * SRFI-171:: Transducers @end menu @@ -5662,6 +5663,35 @@ Return the current contents of @var{box}. Set the contents of @var{box} to @var{value}. @end deffn +@node SRFI-119 +@subsection SRFI-119 Wisp: simpler indentation-sensitive Scheme. +@cindex SRFI-119 +@cindex wisp + +The languages shipped in Guile include SRFI-119, also referred to as +@dfn{Wisp} (for ``Whitespace to Lisp''), an encoding of Scheme that +allows replacing parentheses with equivalent indentation and inline +colons. See +@uref{http://srfi.schemers.org/srfi-119/srfi-119.html, the specification +of SRFI-119}. Some examples: + +@example +display "Hello World!" @result{} (display "Hello World!") +@end example + +@example +define : factorial n @result{} (define (factorial n) + if : zero? n @result{} (if (zero? n) + . 1 @result{} 1 + * n : factorial @{n - 1@} @result{} (* n (factorial @{n - 1@})))) +@end example + +To execute a file with Wisp code, select the language and filename +extension @code{.w} vie @code{guile --language=wisp -x .w}. + +In files using Wisp, @xref{SRFI-105} (Curly Infix) is always activated. + + @node SRFI-171 @subsection Transducers @cindex SRFI-171 @@ -5705,6 +5735,7 @@ left-to-right, due to how transducers are initiated. * SRFI-171 Helpers:: Utilities for writing your own transducers @end menu + @node SRFI-171 General Discussion @subsubsection SRFI-171 General Discussion @cindex transducers discussion |