Merge scheme-forms into macros: named let, letrec, dynamic-wind, eq?/eqv?/equal?

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 01:16:16 +00:00
7 changed files with 785 additions and 26 deletions

View File

@@ -121,7 +121,7 @@
(define-primitive "="
:params (a b)
:returns "boolean"
:doc "Equality (value equality, not identity).")
:doc "Deep structural equality. Alias for equal?.")
(define-primitive "!="
:params (a b)
@@ -129,6 +129,27 @@
:doc "Inequality."
:body (not (= a b)))
(define-primitive "eq?"
:params (a b)
:returns "boolean"
:doc "Identity equality. True only if a and b are the exact same object.
For immutable atoms (numbers, strings, booleans, nil) this may or
may not match — use eqv? for reliable atom comparison.")
(define-primitive "eqv?"
:params (a b)
:returns "boolean"
:doc "Equivalent value for atoms, identity for compound objects.
Returns true for identical objects (eq?), and also for numbers,
strings, booleans, and nil with the same value. For lists, dicts,
lambdas, and components, only true if same identity.")
(define-primitive "equal?"
:params (a b)
:returns "boolean"
:doc "Deep structural equality. Recursively compares lists and dicts.
Same semantics as = but explicit Scheme name.")
(define-primitive "<"
:params (a b)
:returns "boolean"