Output of macros will probably be more readable.
Inline _macro_wrap and _unwrap for efficiency (there are less
primitive operations for maps than for vectors).
Basic check of `map?` and `macro?`. Swap them in order to simplify the
diff with cb9b0654.
Let `with-meta f m` create a function even if f is a macro, instead of
setting an "ismacro" metadata that is never used again (and breaks
self-hosting).
Also move the test for fn? from Optional to Deferrable, the function
is used for self-hosting.
* Move `gensym` and `inc` from step files to `lib/trivial.mal`.
* Move `or` from step files to `lib/test_cascade.mal`.
Shorten it because `(first ())` returns `nil`
* Update process and tests accordingly (not the figures yet).
equality.mal:
- fix typos
- let and2 and or2 always return booleans
- when looping in sequences, compare lengths only once
- empty? instead of an equality test
- when looping on a keys, do not check if a contains the current key
- change the `cond` logic: when a is a sequence and b a map, return
false instead of delegating to scalar-equal?.
- add tests
memoize.mal:
- make explicit that the function name must be kept
- fix typo in tests
protocols.mal:
- document
- add a function mapping an object to its type
- add default types for remaining built-in MAL values
- let defprotocol return the new protocol instead of last method
- set the right profile for abstract methods, improving error messages
- replace incomplete example with lots of tests
pprint:
- escape parenthesis in expected test results
[kanaka]
- explain in lib/README.md how to run tests/lib/*.
- rename folds to reducers and composition to threading
- move fib and sumdown from lib/ to tests/
Partial translation of examples from lib/ to new tests.
Correct test of memoize.
`reduce`, `foldr`, `every?`, `some` and `and` were previously not
tested in tests/step*.mal. Tests them in `tests/lib/` instead.
In the BBC BASIC implementation, the empty list, vector, and hash-mapp
are distinguished values and detected by their address. Adding metadata
to them makes a copy, and then they don't work properly any more.
Self-hosting currently requires that these functions be defined so
that the mal implementation can pass them through. This test
minimally ensures that.
tests: check that `inc` is present in stepA.
nasm: split lines in mal_startup_string for readability.
objpascal: remove obsolete .orig file
swift: remove an unneeded line in template
swift4: remove duplicate definition of `or` macro
In Java the time-ms value was negative. This actually still works fine
because arithmetic comparison is still correct. So allow signed
time-ms results.
- tests/*: marked with deferable and optional runtest flags. Some
moving around of tests within different sections to more closely
align with the guide.
- runtest.py has --deferable/--no-deferable and
--optional/--no-optional to control whether tests marked as
deferable and optional are tested.
- Makefile: DEFERABLE and OPTIONAL top level flags to be passed to
runtest when running tests.
- Also, fix problems in java quoting revealed by step7 test changes.
- Move some of the more optional things (conj, readline) to stepA. All
implementations pass step9 tests now.
- Move metadata and atoms to stepA.
- Update step9 and stepA diagrams.