mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-13 15:57:36 +02:00
Get hello example to work
This commit is contained in:
parent
9b1b833b89
commit
2e16c27b42
2 changed files with 1 additions and 25 deletions
24
TODO
24
TODO
|
@ -3,30 +3,6 @@ Working TODO list:
|
|||
- Issues with library hello example:
|
||||
|
||||
1) Need to manually assign Cyc_global_variables in lib2.c
|
||||
2) Need to add this manually, need to compute it:
|
||||
|
||||
extern void c_libslib2_entry_pt(int argc, closure cont);
|
||||
extern void c_libslib1_entry_pt(int argc, closure cont);
|
||||
extern void c_schemebase_entry_pt(int argc, closure cont);
|
||||
static void c_entry_pt(argc, env,cont) int argc; closure env,cont; {
|
||||
// TODO: should do these explicitly instead of using macros, in case they are not generated
|
||||
mclosure1(c_done, __lambda_3, &c_done);
|
||||
mclosure1(c_lib2, c_libslib2_entry_pt, &c_done);
|
||||
mclosure1(c_lib1, c_libslib1_entry_pt, &c_lib2);
|
||||
mclosure1(c_base, c_schemebase_entry_pt, &c_lib1);
|
||||
|
||||
// TODO: need to change each entry point to accept above closures
|
||||
// will need to check in each one for closure1 or closure0, I think???
|
||||
(c_base.fn)(0, &c_base);
|
||||
}
|
||||
|
||||
3) Need to change signature of library entry_pt functions, and append this at the end:
|
||||
|
||||
cont = ((closure1_type *)cont)->elt1;
|
||||
((cont)->fn)(0, cont);
|
||||
|
||||
Alternatively, we can leave the existing signature and pass cont twice...
|
||||
|
||||
|
||||
- Reduction in size of generated code
|
||||
is there anything we can do?
|
||||
|
|
2
cgen.scm
2
cgen.scm
|
@ -1073,7 +1073,7 @@
|
|||
required-libs)
|
||||
(emit
|
||||
;; Start cont chain, but do not assume funcall1 macro was defined
|
||||
(string-append "(" prev-clo ".fn)(0, &" prev-clo ", &" prev-clo ");"))
|
||||
(string-append "(" this-clo ".fn)(0, &" this-clo ", &" this-clo ");"))
|
||||
(emit "}")
|
||||
(emit "static void c_entry_pt_first_lambda(int argc, closure env, closure cont) {")
|
||||
(emit (string-append "printf(\"init first lambda\\n\");"))
|
||||
|
|
Loading…
Add table
Reference in a new issue