X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scheme.forth.jl.git;a=blobdiff_plain;f=scheme-library.scm;h=9a9358c626c665f2ecd46c2c8fee9891e1000315;hp=5ee0b49c2c7e88b4bfb4a922df27b4dd52e70a03;hb=f0a8c4a13b2c6d38fd8fe9e1dedb75997386a6e0;hpb=55761030cc43072bbc8b2d1ef5a053fc64a6a3ec 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