lib/: add tests, fix detected problems, improve implementations
[jackhill/mal.git] / lib / README.md
CommitLineData
3e9b89d4
NB
1This directory contains general-purpose reusable code that does not
2fit in the process like `cond`, `gensym`, `inc`, `not` and `or`.
3
4The split in small files is motivated by implementations too limited
5to load a single big file, but MAL has no proper module management.
6
7However, here are some guidelines.
8
9- Begin with an one-line ;; short description
10
11- End with `nil`, so that the result of `load-file` is conveniently
12 short when loading manually and predictilbe for automatic testing
13
14- Describe the restrictions on each parameter in comments.
15
16- Define private symbols in hidden environments when possible. If this
17 is not possible, for example for macros, give them a name starting
18 with an underscore.
19
20- Support successive imports safely by giving the same definitions
21 again.
83665b4f
NB
22
23If a module provides tests, you may run against an implementation IMPL
24with these commands.
25```
26make IMPL^stepA
27cd tests
28python ../runtest.py lib/MODULE.mal ../IMPL/run
29```