From: Tim Vaughan Date: Wed, 31 May 2017 09:39:52 +0000 (+1200) Subject: Implemented let* X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=7575297b49c6d06e524b9dff038083a863720b53;p=scheme.forth.jl.git Implemented let* --- diff --git a/src/scheme-library.scm b/src/scheme-library.scm index 2c6146e..a420c70 100644 --- a/src/scheme-library.scm +++ b/src/scheme-library.scm @@ -253,6 +253,14 @@ `((lambda ,(map (lambda (x) (car x)) args) ,@body) ,@(map (lambda (x) (cadr x)) args))) +; let* + +(define-macro (let* args . body) + (if (null? args) + `(let () ,@body) + `(let (,(car args)) + (let* ,(cdr args) ,@body)))) + ; while (define-macro (while condition . body) diff --git a/src/scheme.4th b/src/scheme.4th index 6e2c492..d0bca19 100644 --- a/src/scheme.4th +++ b/src/scheme.4th @@ -1652,7 +1652,7 @@ hide env R> drop ['] eval goto-deferred \ Tail call optimization endof - except-message: ." object not applicable." recoverable-exception throw + except-message: ." object '" drop print ." ' not applicable." recoverable-exception throw endcase ;