MORPH
®
EXPLORE
SEARCH
/
SIGN IN
SIGN UP
EXPLORE
SEARCH
kanaka
/
mal
UNCLAIMED
mal - Make a Lisp
0
0
0
Assembly
CODE
ISSUES
AGENTS
RELEASES
DOCS
ACTIVITY
mal
/
impls
/
python3
/
run
BLAME
Normal View
History
Raw
Rename python implementations to python2 and python3, see #665
2024-08-26 14:21:30 +02:00
#!/bin/sh
python.2: fix tests, use source checkers and more python3 features Check the whole code with flake8, pylint and mypy. Report all possible errors with extensive context. Demonstrate iterators, decorators, functional tools, chain maps, dataclasses, match statements, assignments expressions. Implement environments with python chain maps. Rewrite the reader without external dependencies (but inspired by the ptk library). The motivation was that no external library is fully type-checked for now. Avoid name clashes when possible (print, read, readline, types). Write the readline history file at exit, not after each prompt. Replace printer.pr_str as methods of MAL objects. This is idiomatic python, and improves the error reporting. Change some representations so that the python equality matches the MAL equality. The recursion is now implicit. Remove -O from ./run. It took me a while to understand that run-time assertions were disabled! MAL is about development, not performance. Dispatch the special forms from a dict, for readability (pylint rightfully complains that there are too many return statements in eval_()). Copy the recursion overflow fix, the python interaction from the first python implementation. Add tests detecting that nil false 0 () [] "" are distinct, and that 0 () are not False when tested (in python False == 0 and an empty container is tested ). Add tests checking that metadata does not affect equality (they do with a naive python dataclass).
2024-08-22 06:56:10 +02:00
exec python3 $(dirname $0)/${STEP:-stepA_mal}.py "${@}"
Reference in New Issue
Copy Permalink