diff --git a/mes.c b/mes.c index 808a64e7..7e5ba3a5 100644 --- a/mes.c +++ b/mes.c @@ -184,6 +184,7 @@ SCM r3 = 0; // param 3 #define MAKE_CHAR(n) make_cell (tmp_num_ (CHAR), 0, tmp_num2_ (n)) #define MAKE_NUMBER(n) make_cell (tmp_num_ (NUMBER), 0, tmp_num2_ (n)) #define MAKE_REF(n) make_cell (tmp_num_ (REF), n, 0); +#define MAKE_STRING(x) make_cell (tmp_num_ (STRING), x, 0); SCM display_ (FILE* f, SCM x); SCM vm_call (function0_t f, SCM p1, SCM p2, SCM a); @@ -693,13 +694,6 @@ tmp_num2_ (int x) return tmp_num2; } -SCM -make_string (SCM x) -{ - g_cells[tmp_num].value = STRING; - return make_cell (tmp_num, x, 0); -} - SCM cstring_to_list (char const* s) { diff --git a/string.c b/string.c index f3eb2b17..1bc16298 100644 --- a/string.c +++ b/string.c @@ -21,7 +21,7 @@ SCM string (SCM x) ///((arity . n)) { - return make_string (x); + return MAKE_STRING (x); } SCM @@ -35,13 +35,13 @@ string_append (SCM x) ///((arity . n)) p = append2 (p, STRING (s)); x = cdr (x); } - return make_string (p); + return MAKE_STRING (p); } SCM list_to_string (SCM x) { - return make_string (x); + return MAKE_STRING (x); } SCM @@ -81,7 +81,7 @@ substring (SCM x) ///((arity . n)) p = append2 (p, cons (MAKE_CHAR (VALUE (car (s))), cell_nil)); s = cdr (s); } - return make_string (p); + return MAKE_STRING (p); } SCM @@ -94,7 +94,7 @@ number_to_string (SCM x) p = cons (MAKE_CHAR (n % 10 + '0'), p); n = n / 10; } while (n); - return make_string (p); + return MAKE_STRING (p); } SCM @@ -108,7 +108,7 @@ SCM symbol_to_string (SCM x) { assert (TYPE (x) == SYMBOL); - return make_string (STRING (x)); + return MAKE_STRING (STRING (x)); } SCM