1; SketchyLISP Library
2; Copyright (C) 2005,2006,2007 Nils M Holm. All rights reserved.
3; See the file LICENSE of the SketchyLISP distribution
4; for conditions of use.
5
6; ---name---
7; let*
8
9; ---conformance---
10; R5RS
11
12; ---purpose---
13; Bind values sequentially.
14; .B
15; .C (let* ((a 1) (b a)) b)
16; .B
17; equals
18; .B
19; .C (let ((a 1)) (let ((b a)) b))
20
21; ---args---
22; N - name
23; V - value
24; X - expression (body)
25
26; ---keywords---
27; LET*, binding, sequential
28
29; ---see-also---
30
31; ---example---
32; ; Example needs pre-loaded image
33; (let* ((a 1) (b (+ 1 a))) b) --> 2
34
35; ---code---
36(define-syntax let*
37  (syntax-rules ()
38    ((_ () x)
39       (let () x))
40    ((_ ((n v)) x)
41       (let ((n v)) x))
42    ((_ ((n1 v1) (n2 v2) ...) x)
43       (let ((n1 v1))
44         (let* ((n2 v2) ...) x)))))
45