mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
WIP
This commit is contained in:
parent
b5248cb965
commit
cb97cfbac7
1 changed files with 11 additions and 3 deletions
|
@ -1223,8 +1223,16 @@
|
||||||
;;
|
;;
|
||||||
;; Compile a reference to an element of a closure.
|
;; Compile a reference to an element of a closure.
|
||||||
(define (c-compile-closure-element-ref ast-id var idx)
|
(define (c-compile-closure-element-ref ast-id var idx)
|
||||||
(string-append
|
(with-fnc ast-id (lambda (fnc)
|
||||||
"((closureN)" (mangle var) ")->elements[" idx "]"))
|
(trace:info `(c-compile-closure-element-ref ,ast-id ,var ,idx ,fnc))
|
||||||
|
(cond
|
||||||
|
((and (adbf:well-known fnc)
|
||||||
|
(pair? (adbf:all-params fnc))
|
||||||
|
(equal? (adbf:closure-size fnc) 1))
|
||||||
|
(mangle (car (adbf:all-params fnc))))
|
||||||
|
(else
|
||||||
|
(string-append
|
||||||
|
"((closureN)" (mangle var) ")->elements[" idx "]"))))))
|
||||||
|
|
||||||
|
|
||||||
;; c-compile-closure : closure-exp (string -> void) -> string
|
;; c-compile-closure : closure-exp (string -> void) -> string
|
||||||
|
@ -1319,7 +1327,7 @@
|
||||||
)))))
|
)))))
|
||||||
;(trace:info (list 'JAE-DEBUG trace macro?))
|
;(trace:info (list 'JAE-DEBUG trace macro?))
|
||||||
(cond
|
(cond
|
||||||
(#f ;;TODO: use-obj-instead-of-closure?
|
(use-obj-instead-of-closure?
|
||||||
(create-object))
|
(create-object))
|
||||||
(else
|
(else
|
||||||
(c-code/vars
|
(c-code/vars
|
||||||
|
|
Loading…
Add table
Reference in a new issue