lumbda/asm
russell@unturf.com 99b0622520 asm: values + call-with-values + #(...) reader + exit + vector equal?
Closes the remaining asm-side gaps from ticket 0005's follow-up
discussion. Every test in tests/cl-compat.lsp and tests/ursa.lsp
now runs unmodified on default asm (Scheme port) and asm-full (full
CL path) — no more commented-out tests or shim syntax.

Landed (all in default asm — useful beyond cl-compat):

  * (values . xs) / (call-with-values producer consumer). values
    packs a tagged pair (mval_marker . xs) when multiple; a lone arg
    passes through unchanged so legacy single-value code is
    undisturbed. call-with-values invokes the producer, destructures
    the multi-value packet if present, applies consumer positionally.
    The marker is a gensymed symbol interned once at init, so no
    user-constructed pair can masquerade as a multi-value packet.

  * (exit [code]) builtin. Default code is 0 when called with no
    args. Passes through to the SYS_EXIT syscall.

  * #(...) vector literal in the reader. .sr_hash now dispatches on
    '(' as a vector literal alongside 't' and 'f'. list_to_vector_
    reader is a standalone helper callable from the reader (separate
    from bi_listtovec which uses the GETARG builtin convention).
    Matches R7RS vector literal syntax. Existing vector builtins
    already handled construction; this just teaches the reader.

  * deep_equal extended to vectors. equal? now descends into vectors
    (length + elementwise recursive compare), matching R7RS.
    Previously only strings and pairs were handled; vectors fell
    through to shallow pointer compare which only matched identical
    heap objects.

Test file reverts (picking up the new capabilities):

  * tests/cl-compat.lsp — multiple-value-bind test restored
    (previously commented out because asm lacked values /
    call-with-values).
  * tests/ursa-scheme.lsp — #(1 0 1 0 1 0) literal restored
    (previously worked around with (vector->list (digits ...)));
    (exit 1) failure trailer restored (previously removed because
    asm had no exit builtin).
  * tests/ursa.lsp — same digits literal restoration.

Verified:
  * asm regression: 158/158.
  * asm-full regression: 158/158.
  * Zoë-favorites across Python + C + asm + asm-full: all suites
    green with native reader syntax and multi-value tests.
  * make test-all stays green.
2026-04-24 12:38:47 -04:00
..
lumbda asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
lumbda-full asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
lumbda-full.o asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
lumbda-gc asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
lumbda-gc.o asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
lumbda.o asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
lumbda.s asm: values + call-with-values + #(...) reader + exit + vector equal? 2026-04-24 12:38:47 -04:00
Makefile asm/lumbda-full: quasiquote + define-macro + prelude (ticket 0005) 2026-04-24 12:02:12 -04:00
test.sh asm: rest args, cadr, sort, let* — Scheme port of Zoë's favorites runs 2026-04-24 09:01:32 -04:00