[this wonderful series of blog
posts](http://peter.michaux.ca/articles/scheme-from-scratch-introduction)) from
C to forth, but also includes variadic compound function support, mark-sweep
-garbage collection, quasiquotation, and a very basic (non-hygenic) macro
+garbage collection, quasiquotation, and a basic (non-hygienic) macro
system.
In future, I plan to also implement a more complete numerical tower to bring it closer to
; let
-(define (let-vars args)
- (if (null? args)
- '()
- (cons (caar args) (let-vars (cdr args)))))
-
-(define (let-inits args)
- (if (null? args)
- '()
- (cons (cadar args) (let-inits (cdr args)))))
-
(define-macro (let args . body)
- `((lambda ,(let-vars args)
- ,@body) ,@(let-inits args)))
+ `((lambda ,(map (lambda (x) (car x)) args)
+ ,@body) ,@(map (lambda (x) (cadr x)) args)))
; while