core: Remove make_keyword.

* mes.c (make_keyword): Remove.
* module/mes/read-0.mes (<cell:keyword>): New global.
  (read-word): Use it with make_cell instead fo make-keyword.
* strting.c (symbol_to_keyword): Use make_cell instead of make_keyword.
This commit is contained in:
Jan Nieuwenhuizen 2016-12-23 15:53:57 +01:00
parent 976c86318e
commit 89e78bec77
3 changed files with 4 additions and 11 deletions

9
mes.c
View File

@ -693,15 +693,6 @@ make_function (SCM name, SCM id, SCM arity)
return make_cell (tmp_num3, name, tmp_num4);
}
SCM
make_keyword (SCM s)
{
SCM x = lookup_symbol_ (s);
x = x ? x : make_symbol_ (s);
g_cells[tmp_num].value = KEYWORD;
return make_cell (tmp_num, STRING (x), 0);
}
SCM
make_number (int x)
{

View File

@ -104,6 +104,7 @@
;; * lookup in Scheme
;; * read characters, quote, strings
(define <cell:keyword> 2)
(define (read)
(read-word (read-byte) (list) (current-module)))
@ -283,7 +284,7 @@
((eq? (peek-byte) 39) (read-byte)
(cons (quote syntax) (cons (read-word (read-byte) w a) (list))))
((eq? (peek-byte) 58) (read-byte)
(make-keyword (symbol->list (read-word (read-byte) (list) a))))
(make-cell <cell:keyword> (symbol->list (read-word (read-byte) (list) a)) 0))
((eq? (peek-byte) 59) (read-byte)
(read-word (read-byte) w a)
(read-word (read-byte) w a))

View File

@ -122,5 +122,6 @@ SCM
symbol_to_keyword (SCM x)
{
assert (TYPE (x) == SYMBOL);
return make_keyword (STRING (x));
g_cells[tmp_num].value = KEYWORD;
return make_cell (tmp_num, STRING (x), 0);
}