diff options
| author | 2025-09-01 20:16:52 -0400 | |
|---|---|---|
| committer | 2025-09-01 20:19:58 -0400 | |
| commit | 77362ba7969ec4f31ff8f5a19216827dc2691c6c (patch) | |
| tree | 2fc015d4cf8927a91d9188d62823c943a79031fe /README.md | |
| parent | fix list-tail, add some tests (diff) | |
0.1.0
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -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 |
