From f0a8c4a13b2c6d38fd8fe9e1dedb75997386a6e0 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Sun, 6 Nov 2016 13:27:32 +1300 Subject: [PATCH] While form now uses let. --- README.md | 5 +++-- scheme-library.scm | 17 ++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1a48c10..a435f53 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,9 @@ life as a fairly direct port of Peter Micheaux's [Bootstrap Scheme](https://github.com/petermichaux/bootstrap-scheme) (as described in [this wonderful series of blog posts](http://peter.michaux.ca/articles/scheme-from-scratch-introduction)) from -C to forth, but also includes a basic mark-sweep garbage collector, quasiquotation, -and a very basic (non-hygenic) macro system. +C to forth, but also includes variadic compound function support, mark-sweep +garbage collection, quasiquotation, and a very basic (non-hygenic) macro +system. In future, I plan to also implement a more complete numerical tower to bring it closer to [R5RS](http://www.schemers.org/Documents/Standards/R5RS/). diff --git a/scheme-library.scm b/scheme-library.scm index 5ee0b49..9a9358c 100644 --- a/scheme-library.scm +++ b/scheme-library.scm @@ -33,8 +33,8 @@ () (append (reverse (cdr l)) (list (car l))))) -;; LIBRARY FORMS +;; LIBRARY SPECIAL FORMS ; let @@ -55,12 +55,15 @@ ; while (define-macro (while condition . body) - (define loop (gensym)) - `(begin - (define (,loop) - (if ,condition - (begin ,@body (,loop)))) - (,loop))) + (let ((loop (gensym))) + `(begin + (define (,loop) + (if ,condition + (begin ,@body (,loop)))) + (,loop)))) + +; cond + ;; TESTING -- 2.20.1