mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 20:45:06 +02:00
Proof-of-concept for Cyc-foreign-value
This commit is contained in:
parent
d345d71da9
commit
4006ca560d
2 changed files with 12 additions and 1 deletions
|
@ -992,6 +992,13 @@
|
||||||
"boolean_f")
|
"boolean_f")
|
||||||
args))
|
args))
|
||||||
|
|
||||||
|
((eq? 'Cyc-foreign-value fun)
|
||||||
|
;; TODO: take type into account, do not hardcode int
|
||||||
|
(c-code/vars
|
||||||
|
(string-append
|
||||||
|
"obj_int2obj(" (car args) ")")
|
||||||
|
(list)))
|
||||||
|
|
||||||
((prim? fun)
|
((prim? fun)
|
||||||
(let* ((c-fun
|
(let* ((c-fun
|
||||||
(c-compile-prim fun cont ast-id))
|
(c-compile-prim fun cont ast-id))
|
||||||
|
|
|
@ -90,6 +90,7 @@
|
||||||
Cyc-list
|
Cyc-list
|
||||||
Cyc-if
|
Cyc-if
|
||||||
Cyc-foreign-code
|
Cyc-foreign-code
|
||||||
|
Cyc-foreign-value
|
||||||
Cyc-fast-plus
|
Cyc-fast-plus
|
||||||
Cyc-fast-sub
|
Cyc-fast-sub
|
||||||
Cyc-fast-mul
|
Cyc-fast-mul
|
||||||
|
@ -240,6 +241,7 @@
|
||||||
(Cyc-stderr 0 0)
|
(Cyc-stderr 0 0)
|
||||||
(Cyc-if 3 3)
|
(Cyc-if 3 3)
|
||||||
(Cyc-foreign-code 1 #f)
|
(Cyc-foreign-code 1 #f)
|
||||||
|
(Cyc-foreign-value 2 2)
|
||||||
(Cyc-fast-plus 2 2)
|
(Cyc-fast-plus 2 2)
|
||||||
(Cyc-fast-sub 2 2)
|
(Cyc-fast-sub 2 2)
|
||||||
(Cyc-fast-mul 2 2)
|
(Cyc-fast-mul 2 2)
|
||||||
|
@ -531,7 +533,8 @@
|
||||||
((eq? p 'Cyc-stderr) "Cyc_stderr")
|
((eq? p 'Cyc-stderr) "Cyc_stderr")
|
||||||
((eq? p 'Cyc-list) "Cyc_list")
|
((eq? p 'Cyc-list) "Cyc_list")
|
||||||
((eq? p 'Cyc-if) "Cyc_if")
|
((eq? p 'Cyc-if) "Cyc_if")
|
||||||
((eq? p 'Cyc-foreign-code) "TODO")
|
((eq? p 'Cyc-foreign-code) "UNDEF")
|
||||||
|
((eq? p 'Cyc-foreign-value) "UNDEF")
|
||||||
((eq? p 'Cyc-fast-plus) "Cyc_fast_sum")
|
((eq? p 'Cyc-fast-plus) "Cyc_fast_sum")
|
||||||
((eq? p 'Cyc-fast-sub) "Cyc_fast_sub")
|
((eq? p 'Cyc-fast-sub) "Cyc_fast_sub")
|
||||||
((eq? p 'Cyc-fast-mul) "Cyc_fast_mul")
|
((eq? p 'Cyc-fast-mul) "Cyc_fast_mul")
|
||||||
|
@ -705,6 +708,7 @@
|
||||||
(memq p '(
|
(memq p '(
|
||||||
Cyc-list
|
Cyc-list
|
||||||
Cyc-foreign-code
|
Cyc-foreign-code
|
||||||
|
Cyc-foreign-value
|
||||||
Cyc-fast-plus
|
Cyc-fast-plus
|
||||||
Cyc-fast-sub
|
Cyc-fast-sub
|
||||||
Cyc-fast-mul
|
Cyc-fast-mul
|
||||||
|
|
Loading…
Add table
Reference in a new issue