aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2025-09-01 20:16:52 -0400
committerGravatar Peter McGoron 2025-09-01 20:19:58 -0400
commit77362ba7969ec4f31ff8f5a19216827dc2691c6c (patch)
tree2fc015d4cf8927a91d9188d62823c943a79031fe /README.md
parentfix list-tail, add some tests (diff)
0.1.0
Diffstat (limited to 'README.md')
-rw-r--r--README.md21
1 files changed, 19 insertions, 2 deletions
diff --git a/README.md b/README.md
index 8ae18a4..568bda7 100644
--- a/README.md
+++ b/README.md
@@ -7,8 +7,25 @@
>
> -- Revisedⁿ Reports on the Algorithmic Language Scheme (n ≥ 3, 1986–)
-HaScheme is a pure, call-by-need dialect of Scheme (R7RS), embedded within
-Scheme itself. Procedures in HaScheme can be written in ways that look
+HaScheme is a library that implements a subset of the R7RS's libraries
+in a lazy way, using `force` and `delay-force`. When HaScheme is used
+by itself, it is a lazy functional programming language with the same
+syntax as Scheme, embedded within Scheme.
+
+For instance, the following `map` implementation is both valid HaScheme
+(importing `(hascheme base)`) and Scheme (importing `(scheme base)`):
+
+ (define (map f list)
+ (if (null? list)
+ '()
+ (cons (f (car list)) (map f (cdr list)))))
+
+Since HaScheme is lazy, this function will return a promise. The
+function's body is only executed if, when attempting to `force`
+a promise containing the map, the contents of the map are needed for
+a computation.
+
+Procedures in HaScheme can be written in ways that look
identical to regular Scheme. They do not need to be explicitly `delay`ed
or `delay-force`ed, and they only need to `force` to reduce space usage.
HaScheme procedures return promises which can be forced by regular