1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 09:10:22 +02:00

Change function type representation

This commit is contained in:
Ian Price 2015-06-21 00:45:09 +01:00
parent a7b2dfa581
commit e9f37e6a31
4 changed files with 68 additions and 82 deletions

View file

@ -23,12 +23,9 @@
(($ program ((ids . funs) ...))
(for-each analyse funs))
(($ function self tail body)
(analyse body))
(($ jump-table spec)
(for-each (lambda (p) (analyse (cdr p)))
spec))
(($ function self tail ((($ kid ids) _ bodies) ...))
(for-each count-inc! ids) ;; count-inf! ?
(for-each analyse bodies))
(($ continuation params body)
(analyse body))
@ -184,18 +181,15 @@
(exp exp)))
(define (handle-function fun)
(define (handle-bindings bindings)
(map (lambda (binding)
(match binding
(($ var id ($ continuation params body))
(make-var id (make-continuation params (inline body '()))))))
bindings))
(match fun
(($ function self tail ($ local bindings ($ jump-table spec)))
(($ function self tail ((ids params bodies) ...))
(make-function self
tail
(make-local (handle-bindings bindings)
(make-jump-table spec))))))
(map (lambda (id param body)
(list id param (inline body '())))
ids
params
bodies)))))
(match exp
(($ program ((ids . funs) ...))