fix lambdas and add a test to prevent rotting

Lambdas rotted because there wasn't any test for them, and after
return type moved to the end, lambdas stayed assumning it in the
front. We fix this and add test program
This commit is contained in:
2026-09-27 16:11:05 +03:00
parent 62316e1e3d
commit 26e8e6c374
5 changed files with 54 additions and 10 deletions

View File

@@ -380,8 +380,8 @@ forms, and what remains."
(map arg-type (remove comment-form? form)))
(define (walk-function form)
;; (fn ret-type name arglist body) -> normal function
;; (fn ret-type name arglist) -> prototype
;; (fn name arglist ret-type body) -> normal function
;; (fn name arglist ret-type) -> prototype
(if (>= (length form) 5)
(walk-fn-def form)
(cons '%prototype (cdr (walk-fn-def form)))))