- Core Common Lisp sources live at the repo root, notably
py.lisp(Python emitter),pipe.lisp(pipeline helpers), andpackage.lisp/cl-py-generator.asd(package/system definitions). - Tests are defined in
transpiler-tests.lisp; the differential tests for the parenthesis elision live inparen-tests.lisp. Thetests.lispfile is ad-hoc scratch usage, not the main suite. - Example outputs and experiments are under
example/(many numbered subprojects). - Tooling and hooks live in
tools/(notablylisp-formatand a pre-commit script). SUPPORTED_FORMS.mdis generated from tests; do not edit it by hand.
./run-tests.shruns SBCL, loadstranspiler-tests.lisp, and executesrun-transpiler-tests.- When running SBCL tests or tools programmatically, always pass the
--disable-debuggercommand-line argument. This prevents SBCL from hanging in the interactive debugger on error. Refer to the lisp-dev skill for detailed options. ./run-paren-tests.shruns the differential tests of the parenthesis elision: every expression is emitted with and without:omit-redundant-parenthesesand both variants are evaluated bypython3, so a dropped parenthesis shows up as a different value../generate-docs.shregeneratesSUPPORTED_FORMS.mdfrom the test cases.- Both scripts assume Quicklisp and the repo path
~/quicklisp/local-projects/cl-py-generator; adjust if your local setup differs.
- Use idiomatic Common Lisp naming (lowercase with hyphens, e.g.,
emit-py,run-transpiler-tests). - Keep s-expression indentation consistent with existing files; prefer formatting via
git lisp-format(seetools/pre-commit). - Avoid editing generated artifacts directly; regenerate them from source tests instead.
- Add new forms to
*test-cases*intranspiler-tests.lispwith:name,:description,:lisp,:python, and:tags. The list is already quoted, so write:tags (:core :call)— an extra quote breaks tag filtering and doc grouping. - Use
:exec-test tand:expected-outputwhen validating runtime behavior. - The test runner formats Python using
ruff formatand executes withpython3; ensure both are available. - Parentheses: the fully parenthesized mode (
:omit-redundant-parentheses nil) is the oracle ofparen-tests.lisp; keep it correct. Never decide about parentheses from the head of a form alone —(- x)prints a unary minus,(+ x)prints justx; useeffective-operator. Every operator named in*infix-operators*,*prefix-operators*,*chaining-operators*or*associative-operators*must appear in*precedence*(check-operator-tablesenforces this at load time). - Float Precision:
print-sufficient-digits-f64relies on the ANSI read/print consistency guarantee: it binds*read-default-float-format*to the type of the number being printed and usesprin1-to-string, then normalizes the exponent marker (d/s/f/l) toeso the literal is valid Python. Never print floats with~G/a fixed digit count here — a mismatch between*read-default-float-format*and the printed float type causes precision loss (double literals were previously truncated to 12 significant digits) or infinite print-reconstruct loops.
- Recent history shows short, descriptive messages (e.g., “pose plotter”) and occasional Conventional Commits (
feat(scope): ...). Keep messages concise and specific. - PRs should include a clear summary, the tests run (or a note if not run), and regenerated docs when emitter behavior changes.