diff --git a/src/ikarus.boot b/src/ikarus.boot index f1382e6..1a8a3b5 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.symbols.ss b/src/ikarus.symbols.ss index e9d3df7..fa08d53 100644 --- a/src/ikarus.symbols.ss +++ b/src/ikarus.symbols.ss @@ -3,7 +3,8 @@ (export gensym gensym? gensym->unique-string gensym-prefix gensym-count print-gensym string->symbol symbol->string getprop putprop remprop property-list - top-level-value top-level-bound? set-top-level-value!) + top-level-value top-level-bound? set-top-level-value! + symbol-value symbol-bound? set-symbol-value!) (import (only (scheme) $make-symbol $symbol-string $set-symbol-string! $symbol-unique-string $set-symbol-unique-string! @@ -14,7 +15,8 @@ gensym-prefix gensym-count print-gensym string->symbol symbol->string getprop putprop remprop property-list - top-level-value top-level-bound? set-top-level-value!)) + top-level-value top-level-bound? set-top-level-value! + symbol-value symbol-bound? set-symbol-value!)) (define gensym (case-lambda @@ -53,6 +55,27 @@ (error 'set-top-level-value! "~s is not a symbol" x)) ($set-symbol-value! x v))) + (define symbol-value + (lambda (x) + (unless (symbol? x) + (error 'symbol-value "~s is not a symbol" x)) + (let ([v ($symbol-value x)]) + (when ($unbound-object? v) + (error 'symbol-value "unbound ~s" x)) + v))) + + (define symbol-bound? + (lambda (x) + (unless (symbol? x) + (error 'symbol-bound? "~s is not a symbol" x)) + (not ($unbound-object? ($symbol-value x))))) + + (define set-symbol-value! + (lambda (x v) + (unless (symbol? x) + (error 'set-symbol-value! "~s is not a symbol" x)) + ($set-symbol-value! x v))) + (define string->symbol (lambda (x) (unless (string? x) diff --git a/src/makefile.ss b/src/makefile.ss index cf1356f..5a7a5ee 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -298,6 +298,9 @@ [string->symbol s i] [symbol->string s i] [gensym->unique-string s i] + [symbol-bound? s i] + [symbol-value s i] + [set-symbol-value! s i] [top-level-bound? s ] [top-level-value s ] [set-top-level-value! s ]