remove capture list from lambdas, they are always pure
Explicitly rename capturing lambdas to closures, they will be implemented later
This commit is contained in:
@@ -242,7 +242,7 @@
|
||||
(let ((lambda-name (make-lambda-name (hash-table-ref env :fn-name)
|
||||
(hash-table-ref env :lambda-counter))))
|
||||
(set! (hash-table-ref env :lambda-aux-code)
|
||||
(append (make-aux-lambda-struct lambda-name form)
|
||||
(append (lift-lambda lambda-name form)
|
||||
(hash-table-ref env :lambda-aux-code)))
|
||||
(set! (hash-table-ref env :lambda-counter)
|
||||
(+ (hash-table-ref env :lambda-counter) 1))
|
||||
@@ -253,11 +253,9 @@
|
||||
(string->symbol
|
||||
(fmt #f "__lambda_" counter "_" enclosing-fn-name)))
|
||||
|
||||
(define (make-aux-lambda-struct name form)
|
||||
(define (lift-lambda name form)
|
||||
(match form
|
||||
(('lambda arglist ret-type captures . body)
|
||||
;; Captures are ignored for now, but
|
||||
;; we'll need them for TODO: closures support
|
||||
(('lambda arglist ret-type . body)
|
||||
(process-fn (copy-form-source! form `(fn ,name ,arglist ,ret-type ,@body))
|
||||
(list)))
|
||||
(else (sex-error form "malformed lambda" form))))
|
||||
|
||||
Reference in New Issue
Block a user