core: Add cstring_to_symbol.
* src/mes.c (make_symbol): Rename from lookup_symbol_. Update callers. (cstring_to_symbol): New function. * src/reader.c (reader_read_identifier_or_number): Use it.
This commit is contained in:
parent
479624fc82
commit
bcb58f0326
|
@ -146,8 +146,8 @@ exec ${GUILE-guile} --no-auto-compile -L $(dirname $0) -C $(dirname $0) -e '(mes
|
|||
(format #f "g_cells[cell_~a].string = MAKE_STRING (scm_~a.string);\n" (function.name f) (function.name f))
|
||||
(format #f "g_cells[cell_~a].car = MAKE_STRING (scm_~a.car);\n" (function.name f) (function.name f)))
|
||||
(if %gcc?
|
||||
(format #f "a = acons (lookup_symbol_ (scm_~a.string), ~a, a);\n\n" (function.name f) (function-cell-name f))
|
||||
(format #f "a = acons (lookup_symbol_ (scm_~a.car), ~a, a);\n\n" (function.name f) (function-cell-name f)))))
|
||||
(format #f "a = acons (make_symbol (scm_~a.string), ~a, a);\n\n" (function.name f) (function-cell-name f))
|
||||
(format #f "a = acons (make_symbol (scm_~a.car), ~a, a);\n\n" (function.name f) (function-cell-name f)))))
|
||||
|
||||
(define (disjoin . predicates)
|
||||
(lambda (. arguments)
|
||||
|
|
|
@ -128,9 +128,6 @@
|
|||
(define (symbol->keyword s)
|
||||
(core:make-cell <cell:keyword> (symbol->list s) 0))
|
||||
|
||||
(define (list->symbol lst)
|
||||
(core:lookup-symbol lst))
|
||||
|
||||
(define (symbol->list s)
|
||||
(core:car s))
|
||||
|
||||
|
|
|
@ -415,7 +415,7 @@ list_of_char_equal_p (SCM a, SCM b) ///((internal))
|
|||
}
|
||||
|
||||
SCM
|
||||
lookup_symbol_ (SCM s)
|
||||
list_to_symbol (SCM s)
|
||||
{
|
||||
SCM x = g_symbols;
|
||||
while (x)
|
||||
|
@ -585,6 +585,12 @@ cstring_to_list (char const* s)
|
|||
return string_to_list (s, strlen (s));
|
||||
}
|
||||
|
||||
SCM
|
||||
cstring_to_symbol (char const *s)
|
||||
{
|
||||
return list_to_symbol (cstring_to_list (s));
|
||||
}
|
||||
|
||||
// extra lib
|
||||
SCM
|
||||
assert_defined (SCM x, SCM e) ///((internal))
|
||||
|
|
|
@ -103,7 +103,7 @@ reader_read_identifier_or_number (int c)
|
|||
}
|
||||
unreadchar (c);
|
||||
buf[i] = 0;
|
||||
return lookup_symbol_ (cstring_to_list (buf));
|
||||
return cstring_to_symbol (buf);
|
||||
}
|
||||
|
||||
SCM
|
||||
|
|
Loading…
Reference in New Issue