Minor scheme changes
This commit is contained in:
parent
095ced6f03
commit
4f8459ae64
@ -76,14 +76,14 @@
|
|||||||
(define (desugar-body body)
|
(define (desugar-body body)
|
||||||
(match body
|
(match body
|
||||||
['() '()]
|
['() '()]
|
||||||
[`(,e) (desugar-exp e)]
|
[(e) (desugar-exp e)]
|
||||||
[`(. ,e*) `(begin ,@(map desugar-exp e*))]))
|
[(e* ...) `(begin ,@(map desugar-exp e*))]))
|
||||||
|
|
||||||
|
|
||||||
;; A-Normalization
|
;; A-Normalization
|
||||||
;; All arguments to lambdas are atomic, all lets have
|
|
||||||
;; <prgm> ::= <top> ...
|
;; <prgm> ::= <top> ...
|
||||||
;; <top> ::= <def> | <exp>
|
;; <top> ::= <def> | <exp>
|
||||||
|
;; <def> ::= (define <var> <exp>)
|
||||||
;; <exp> ::= <aexp>
|
;; <exp> ::= <aexp>
|
||||||
;; | <cexp>
|
;; | <cexp>
|
||||||
;; | (let ((<var> <exp>)) <exp>)
|
;; | (let ((<var> <exp>)) <exp>)
|
||||||
@ -93,6 +93,7 @@
|
|||||||
;; <aexp> ::= (lambda (<var> ...) exp)
|
;; <aexp> ::= (lambda (<var> ...) exp)
|
||||||
;; | <num> | <var> | #t | #f
|
;; | <num> | <var> | #t | #f
|
||||||
;; Atomic expressions are guaranteed to terminate without side effects or errors
|
;; Atomic expressions are guaranteed to terminate without side effects or errors
|
||||||
|
;; - All arguments to lambdas are atomic
|
||||||
;; - All complex (non-atomic) expressions are let-bound or in a tail position
|
;; - All complex (non-atomic) expressions are let-bound or in a tail position
|
||||||
;; - All let expressions bind a single var
|
;; - All let expressions bind a single var
|
||||||
;; - begin expressions are decomposed
|
;; - begin expressions are decomposed
|
||||||
|
Loading…
Reference in New Issue
Block a user