mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-09 14:07:34 +02:00
Added (exit)
This commit is contained in:
parent
2d362dcc0c
commit
5bd3deefa1
5 changed files with 8 additions and 2 deletions
2
TODO
2
TODO
|
@ -1,7 +1,5 @@
|
|||
Working TODO list:
|
||||
|
||||
- Add an (exit) primitive in the compiler and interpreter
|
||||
|
||||
- Issues with detecting cycles:
|
||||
- (equal?) loops forever when comparing two different circular lists
|
||||
- printing *global-environment* in the repl still loops forever
|
||||
|
|
1
cgen.scm
1
cgen.scm
|
@ -433,6 +433,7 @@
|
|||
((eq? p '<=) "__num_lte")
|
||||
((eq? p 'apply) "apply")
|
||||
((eq? p '%halt) "__halt")
|
||||
((eq? p 'exit) "__halt")
|
||||
((eq? p 'error) "Cyc_error")
|
||||
((eq? p 'current-input-port) "Cyc_io_current_input_port")
|
||||
((eq? p 'open-input-file) "Cyc_io_open_input_file")
|
||||
|
|
1
eval.scm
1
eval.scm
|
@ -199,6 +199,7 @@
|
|||
(list '<= <=)
|
||||
(list 'apply apply)
|
||||
(list '%halt %halt)
|
||||
(list 'exit exit)
|
||||
(list 'error error)
|
||||
(list 'cons cons)
|
||||
(list 'cell-get cell-get)
|
||||
|
|
|
@ -1171,6 +1171,10 @@ static void _Cyc_91get_91cvar(object cont, object args) {
|
|||
printf("not implemented\n"); exit(1); }
|
||||
static void _Cyc_91set_91cvar_67(object cont, object args) {
|
||||
printf("not implemented\n"); exit(1); }
|
||||
/* Note we cannot use _exit (per convention) because it is reserved by C */
|
||||
static void _cyc_exit(object cont, object args) {
|
||||
__halt(car(args));
|
||||
}
|
||||
static void __75halt(object cont, object args) {
|
||||
printf("not implemented\n"); exit(1); }
|
||||
static void _cell_91get(object cont, object args) {
|
||||
|
@ -1263,6 +1267,7 @@ defprimitive(_125_123, >=, &__125_123); /* >= */
|
|||
defprimitive(_121_123, <=, &__121_123); /* <= */
|
||||
defprimitive(apply, apply, &_apply); /* apply */
|
||||
defprimitive(_75halt, %halt, &__75halt); /* %halt */
|
||||
defprimitive(exit, exit, &_cyc_exit); /* exit */
|
||||
defprimitive(error, error, &_error); /* error */
|
||||
defprimitive(cons, cons, &_cons); /* cons */
|
||||
defprimitive(cell_91get, cell-get, &_cell_91get); /* cell-get */
|
||||
|
|
|
@ -517,6 +517,7 @@
|
|||
apply
|
||||
%halt
|
||||
error
|
||||
exit
|
||||
cons
|
||||
cell-get
|
||||
set-global!
|
||||
|
|
Loading…
Add table
Reference in a new issue