mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
Change function type representation
This commit is contained in:
parent
a7b2dfa581
commit
e9f37e6a31
4 changed files with 68 additions and 82 deletions
|
@ -140,12 +140,14 @@
|
|||
(($ il:continuation params body)
|
||||
(make-function (map rename-id params) (list (compile-exp body))))
|
||||
|
||||
(($ il:function self tail body)
|
||||
(($ il:function self tail clauses)
|
||||
(make-function (list (rename-id self) (rename-id tail))
|
||||
(list (compile-exp body))))
|
||||
|
||||
(($ il:jump-table specs)
|
||||
(compile-jump-table specs))
|
||||
(append
|
||||
(map (match-lambda
|
||||
((id _ body)
|
||||
(make-var (rename-id id) (compile-exp body))))
|
||||
clauses)
|
||||
(list (compile-jump-table clauses)))))
|
||||
|
||||
(($ il:local bindings body)
|
||||
(make-block (append (map compile-exp bindings) (list (compile-exp body)))))
|
||||
|
@ -278,9 +280,11 @@
|
|||
(map compile-id names)))))))
|
||||
))
|
||||
(fold-right (lambda (a d)
|
||||
(make-branch (compile-test (car a))
|
||||
(compile-jump (car a) (cdr a))
|
||||
(list d)))
|
||||
(match a
|
||||
((id params _)
|
||||
(make-branch (compile-test params)
|
||||
(compile-jump params id)
|
||||
(list d)))))
|
||||
;; FIXME: should throw an error
|
||||
(make-return (make-id "undefined"))
|
||||
specs))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue