core: builtins: MES_MINI.
* include/mes/mes.h (g_mini): New global. * src/mes.c (init): Initialize it with environment variable MES_MINI. * src/builtins.c (mes_builtins): Register a minimal set of builtins when g_mini.
This commit is contained in:
parent
9e684b9886
commit
e1efd41abe
|
@ -59,6 +59,7 @@ char *g_buf;
|
|||
SCM g_continuations;
|
||||
SCM g_symbols;
|
||||
SCM g_symbol_max;
|
||||
int g_mini;
|
||||
|
||||
/* a/env */
|
||||
SCM R0;
|
||||
|
|
|
@ -109,11 +109,27 @@ init_builtin (SCM builtin_type, char const *name, int arity, FUNCTION function,
|
|||
SCM
|
||||
mes_builtins (SCM a) /*:((internal)) */
|
||||
{
|
||||
// TODO minimal: cons, car, cdr, list, null_p, eq_p minus, plus
|
||||
// display_, display_error_, getenv
|
||||
|
||||
SCM builtin_type = make_builtin_type ();
|
||||
|
||||
if (g_mini != 0)
|
||||
{
|
||||
a = init_builtin (builtin_type, "cons", 2, &cons, a);
|
||||
a = init_builtin (builtin_type, "car", 1, &car, a);
|
||||
a = init_builtin (builtin_type, "list", -1, &list, a);
|
||||
a = init_builtin (builtin_type, "eq?", 2, &eq_p, a);
|
||||
a = init_builtin (builtin_type, "-", -1, &minus, a);
|
||||
a = init_builtin (builtin_type, "+", -1, &plus, a);
|
||||
a = init_builtin (builtin_type, "core:display", 1, &display_, a);
|
||||
a = init_builtin (builtin_type, "core:write", 1, &write_, a);
|
||||
a = init_builtin (builtin_type, "core:display-error", 1, &display_error_, a);
|
||||
a = init_builtin (builtin_type, "getenv", 1, &getenv_, a);
|
||||
a = init_builtin (builtin_type, "gc", 0, &gc, a);
|
||||
a = init_builtin (builtin_type, ">", -1, &greater_p, a);
|
||||
a = init_builtin (builtin_type, "<", -1, &less_p, a);
|
||||
a = init_builtin (builtin_type, "make-vector", -1, &make_vector, a);
|
||||
return a;
|
||||
}
|
||||
|
||||
/* src/builtins.c */
|
||||
a = init_builtin (builtin_type, "make-builtin", 4, &make_builtin, a);
|
||||
a = init_builtin (builtin_type, "builtin-name", 1, &builtin_name, a);
|
||||
|
|
Loading…
Reference in a new issue