hold a function type's parameters by value on the interface
A record a pub function type took or returned by value was declared only, so an importer could neither define a callback for it nor call one.
This commit is contained in:
@@ -202,7 +202,10 @@
|
||||
;;;
|
||||
;;; (* const cell) -> ((const . #t) (cell . #t))
|
||||
;;; [cell 4] -> ((cell . #f))
|
||||
;;; (fn ((cell)) int) -> ((cell . #t) (int . #t)) ; declaring is enough
|
||||
;;; (fn ((cell)) int) -> ((cell . #f) (int . #f))
|
||||
;;;
|
||||
;;; A function type takes and returns by value whatever it is held
|
||||
;;; through: C wants the body to define or call one of its functions.
|
||||
(define (type-uses type behind?)
|
||||
(cond
|
||||
((symbol? type) (list (cons type behind?)))
|
||||
@@ -215,7 +218,7 @@
|
||||
(if (array-bound? type) (bound-uses (last type)) (list)))))
|
||||
((fn closure)
|
||||
(if (and (pair? (cdr type)) (list? (second type)))
|
||||
(append-map (lambda (t) (type-uses t #t))
|
||||
(append-map (lambda (t) (type-uses t #f))
|
||||
(signature-types (second type) (last type)))
|
||||
(list)))
|
||||
((struct union enum)
|
||||
|
||||
Reference in New Issue
Block a user