From 89e78bec77c6f228730e9dabc04a7537214ba8a7 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 23 Dec 2016 15:53:57 +0100 Subject: [PATCH] core: Remove make_keyword. * mes.c (make_keyword): Remove. * module/mes/read-0.mes (): 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. --- mes.c | 9 --------- module/mes/read-0.mes | 3 ++- string.c | 3 ++- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/mes.c b/mes.c index ab9c6b66..c2a2cebb 100644 --- a/mes.c +++ b/mes.c @@ -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) { diff --git a/module/mes/read-0.mes b/module/mes/read-0.mes index 699c42fe..93b272a2 100644 --- a/module/mes/read-0.mes +++ b/module/mes/read-0.mes @@ -104,6 +104,7 @@ ;; * lookup in Scheme ;; * read characters, quote, strings + (define 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 (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)) diff --git a/string.c b/string.c index b62a4a94..57550b24 100644 --- a/string.c +++ b/string.c @@ -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); }