mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-08 05:27:35 +02:00
updating libraries and genstubs to use new primitives API
This commit is contained in:
parent
a89956fc16
commit
ded9bbf0b6
9 changed files with 9 additions and 9 deletions
|
@ -46,7 +46,7 @@ static sexp sexp_get_opcode_name (sexp ctx, sexp op) {
|
|||
return sexp_intern(ctx, sexp_opcode_name(op), -1);
|
||||
}
|
||||
|
||||
sexp sexp_init_library (sexp ctx, sexp env) {
|
||||
sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
|
||||
sexp_define_type_predicate(ctx, env, "syntactic-closure?", SEXP_SYNCLO);
|
||||
sexp_define_type_predicate(ctx, env, "lambda?", SEXP_LAMBDA);
|
||||
sexp_define_type_predicate(ctx, env, "cnd?", SEXP_CND);
|
||||
|
|
|
@ -110,7 +110,7 @@ static sexp sexp_disasm (sexp ctx, sexp bc, sexp out) {
|
|||
return disasm(ctx, bc, out, 0);
|
||||
}
|
||||
|
||||
sexp sexp_init_library (sexp ctx, sexp env) {
|
||||
sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
|
||||
sexp_define_foreign_param(ctx, env, "disasm", 2, (sexp_proc1)sexp_disasm, "*current-output-port*");
|
||||
return SEXP_VOID;
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ static sexp sexp_heap_dump (sexp ctx, sexp depth) {
|
|||
return sexp_heap_walk(ctx, sexp_unbox_fixnum(depth), 1);
|
||||
}
|
||||
|
||||
sexp sexp_init_library (sexp ctx, sexp env) {
|
||||
sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
|
||||
sexp_define_foreign(ctx, env, "heap-stats", 0, sexp_heap_stats);
|
||||
sexp_define_foreign_opt(ctx, env, "heap-dump", 1, sexp_heap_dump, SEXP_ONE);
|
||||
return SEXP_VOID;
|
||||
|
|
|
@ -166,7 +166,7 @@ static sexp sexp_random_source_pseudo_randomize (sexp ctx, sexp rs, sexp seed) {
|
|||
return SEXP_VOID;
|
||||
}
|
||||
|
||||
sexp sexp_init_library (sexp ctx, sexp env) {
|
||||
sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
|
||||
sexp_gc_var2(name, op);
|
||||
sexp_gc_preserve2(ctx, name, op);
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ static sexp sexp_bit_set_p (sexp ctx, sexp i, sexp x) {
|
|||
}
|
||||
}
|
||||
|
||||
sexp sexp_init_library (sexp ctx, sexp env) {
|
||||
sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
|
||||
sexp_define_foreign(ctx, env, "bit-and", 2, sexp_bit_and);
|
||||
sexp_define_foreign(ctx, env, "bit-ior", 2, sexp_bit_ior);
|
||||
sexp_define_foreign(ctx, env, "bit-xor", 2, sexp_bit_xor);
|
||||
|
|
|
@ -228,7 +228,7 @@ static sexp sexp_hash_table_delete (sexp ctx, sexp ht, sexp obj) {
|
|||
return SEXP_VOID;
|
||||
}
|
||||
|
||||
sexp sexp_init_library (sexp ctx, sexp env) {
|
||||
sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
|
||||
|
||||
sexp_define_foreign_opt(ctx, env, "string-hash", 2, sexp_string_hash, HASH_BOUND);
|
||||
sexp_define_foreign_opt(ctx, env, "string-ci-hash", 2, sexp_string_ci_hash, HASH_BOUND);
|
||||
|
|
|
@ -172,7 +172,7 @@ static sexp sexp_sort_x (sexp ctx, sexp seq, sexp less, sexp key) {
|
|||
return res;
|
||||
}
|
||||
|
||||
sexp sexp_init_library (sexp ctx, sexp env) {
|
||||
sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
|
||||
sexp_define_foreign_opt(ctx, env, "sort!", 3, sexp_sort_x, SEXP_FALSE);
|
||||
return SEXP_VOID;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ sexp sexp_get_environment_variables (sexp ctx) {
|
|||
return res;
|
||||
}
|
||||
|
||||
sexp sexp_init_library (sexp ctx, sexp env) {
|
||||
sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
|
||||
sexp_define_foreign(ctx, env, "get-environment-variable", 1, sexp_get_environment_variable);
|
||||
sexp_define_foreign(ctx, env, "get-environment-variables", 0, sexp_get_environment_variables);
|
||||
return SEXP_VOID;
|
||||
|
|
|
@ -1212,7 +1212,7 @@
|
|||
(write-utilities)
|
||||
(for-each write-func *funcs*)
|
||||
(for-each write-type-funcs *types*)
|
||||
(cat "sexp sexp_init_library (sexp ctx, sexp env) {\n"
|
||||
(cat "sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {\n"
|
||||
" sexp_gc_var2(name, tmp);\n"
|
||||
" sexp_gc_preserve2(ctx, name, tmp);\n")
|
||||
(for-each write-const *consts*)
|
||||
|
|
Loading…
Add table
Reference in a new issue