about summary refs log tree commit diff stats
path: root/README.md
diff options
context:
space:
mode:
authorCase Duckworth2023-08-29 21:55:12 -0500
committerCase Duckworth2023-08-29 21:55:12 -0500
commit5db553526711c1127abccc422ba92efd6e3e70ea (patch)
tree6c0acd1f03744500c418e514198dc97dbc2d1573 /README.md
parentRemove Makefile and chicanery.base (diff)
downloadchicanery-main.tar.gz
chicanery-main.zip
Update to just be CHICKEN main
Diffstat (limited to 'README.md')
-rw-r--r--README.md44
1 files changed, 14 insertions, 30 deletions
diff --git a/README.md b/README.md index 6c720b7..71083ad 100644 --- a/README.md +++ b/README.md
@@ -1,49 +1,33 @@
1# Chicanery: subtle, opinionated improvements to R7RS Scheme (in CHICKEN) 1# Chicanery: subtle, opinionated improvements to R7RS Scheme for CHICKEN
2 2
3While I was reading the [R7RS 3While I was reading the [R7RS specification][r7rs], I was a little annoyed by how broken up the standard library seemed to be. While the most egregious example is maybe `(scheme case-lambda)`, which exports ... only `case-lambda`, the other libraries like `(scheme write)` for `display`, `(scheme cxr)` for functions like `caddr` but not `cddr`, and the rest didn't really seem logical to me. Plus, in CHICKEN scheme, the one I usually use, `utf8` is an egg you need to install separately...
4specification](https://standards.scheme.org/official/r7rs.pdf), I was a little
5annoyed by how broken up the standard library seemed to be. While the most
6egregious example is maybe `(scheme case-lambda)`, which exports ... only
7`case-lambda`, the other libraries like `(scheme write)` for `display`, `(scheme
8cxr)` for functions like `caddr` but not `cddr`, and the rest didn't really seem
9logical to me. Plus, in CHICKEN scheme, the one I usually use, `utf8` is an egg
10you need to install separately...
11 4
12To ameliorate these minor warts in what I otherwise consider to be an excellent 5To ameliorate these minor warts in what I otherwise consider to be an excellent
13language, `chicanery` was born. It's kind of like a prelude, I suppose? It 6language, `chicanery` was born. It's kind of like a prelude, I suppose? It
14imports all `r7rs` modules and re-exports their identifiers, and makes sure the 7imports all `r7rs` modules and re-exports their identifiers, and makes sure the
15implementation is Unicode-aware. It also includes a few extras ;) 8implementation is Unicode-aware.
16 9
17## Chicanery extras 10## Chicanery extras
18 11
19I also thought it was strange that `map`, `for-each`, and `append` apply to 12The following are included in the chicanery library because I like them.
20lists only, while `vector-map` and `string-for-each`, exist, for example.
21`chicanery` prefixes the default `map`, `for-each`, and `append` functions with
22`list-`, and redefines those identifiers to functions that are generic over
23Scheme's base collection types (lists, strings, vectors, bytevectors where
24applicable). I didn't make the functions fully-generic to keep them efficient
25and because I don't know how to do that, but you can still use `vector-append`
26or `list-map` if you know what type you need and want speed.
27 13
28In a similar vein, I've also added generic functions `ref` and `copy` that 14- `(atom? x)` determines whether `x` is an atom (i.e., not a pair or null)
29dispatch to `string-ref`, `list-copy`, and the like. 15- `(slurp [port])` reads a port until hitting end-of-file (IDK
30 16 why this isn't in R7RS!)
31Other extras include
32
33- `(atom? x)` determines whether `x` is an atom (i.e., not a pair or null)
34- `(read-port)`, `(read-port port)` reads a port until hitting end-of-file (IDK
35 why this isn't in R7RS!), in chunks of `read-port-chunk-size`
36- `(defined? x)` returns whether the symbol `x` is bound to a variable
37- `(with-input-from-string str thunk)` calls `thunk` with `str` bound as the current-input-port. 17- `(with-input-from-string str thunk)` calls `thunk` with `str` bound as the current-input-port.
38- `(with-output-to-string thunk)` calls `thunk` and returns a string of the output. 18- `(with-output-to-string thunk)` calls `thunk` and returns a string of the output.
39- `(displayed x)`, `(->string x)` returns `x` as a string (via `display`) 19- `(displayed x)`, `(->string x)` returns `x` as a string (via `display`)
40- `(written x)` returns `x` as a string (via `write`) 20- `(written x)` returns `x` as a string (via `write`)
41- `(print x ...)` displays `x ...` followed by a newline 21- `(print . xs)` displays `xs` followed by a newline
42 22
43## Todo 23## Todo
44 24
45- Support multiple scheme implementations. I tried doing this (see the [multiple-impls](https://git.acdw.net/chicanery/?h=multiple-impls) branch), but it kept not working in weird ways, plus it was like whack-a-mole with all the different schemes and just exhausting. 25- Support multiple scheme implementations. I tried doing this (see the [multiple-impls][] branch), but it kept not working in weird ways, plus it was like whack-a-mole with all the different schemes and just exhausting.
46 26
47## License 27## License
48 28
49This software is licensed under the GWL, v. 1.0. See [COPYING](https://git.acdw.net/chicanery/tree/COPYING) for details. 29This software is licensed under the GWL, v 1.0. See [COPYING][copying] for details.
30
31[r7rs]: https://standards.scheme.org/official/r7rs.pdf
32[multiple-impls]: https://git.acdw.net/chicanery/?h=multiple-impls
33[copying]: https://git.acdw.net/chicanery/tree/COPYING