add (picrin symbol)

This commit is contained in:
Yuichi Nishiwaki 2014-08-06 02:14:43 +09:00
parent bc47968ea1
commit 772c59dead
5 changed files with 20 additions and 5 deletions

View File

@ -1,6 +1,7 @@
list(APPEND PICLIB_SCHEME_LIBS
${PROJECT_SOURCE_DIR}/piclib/picrin/base.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/list.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/symbol.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/macro.scm
${PROJECT_SOURCE_DIR}/piclib/scheme/base.scm

View File

@ -2,7 +2,7 @@
(import (rename (picrin base core) (define define*))
(picrin base macro)
(picrin base list)
(scheme base))
(picrin base symbol))
(define-syntax define
(lambda (form use-env mac-env)

View File

@ -4,6 +4,7 @@
(import (picrin base macro)
(picrin base)
(picrin list)
(picrin symbol)
(scheme base)
(picrin dictionary))

View File

@ -1,6 +1,7 @@
(define-library (scheme base)
(import (picrin base)
(picrin list)
(picrin symbol)
(picrin macro))
(export define set! lambda quote
@ -842,6 +843,13 @@
assv
assoc)
;; 6.5 Symbols
(export symbol?
symbol=?
symbol->string
string->symbol)
;; 6.6 Characters
(define-macro (define-char-transitive-predicate name op)

View File

@ -149,8 +149,13 @@ pic_symbol_string_to_symbol(pic_state *pic)
void
pic_init_symbol(pic_state *pic)
{
pic_deflibrary (pic, "(picrin base symbol)") {
pic_defun(pic, "symbol?", pic_symbol_symbol_p);
pic_defun(pic, "symbol=?", pic_symbol_symbol_eq_p);
pic_defun(pic, "symbol->string", pic_symbol_symbol_to_string);
pic_defun(pic, "string->symbol", pic_symbol_string_to_symbol);
}
pic_deflibrary (pic, "(picrin symbol)") {
pic_defun(pic, "symbol=?", pic_symbol_symbol_eq_p);
}
}