21.  Symbols  

(string->symbol string)
(symbol->string symbol)

See R^4RS.

(put symbol key value)
(put symbol key)

Associates value with key in the property list of the given symbol. key must be a symbol. Returns key.
If value is omitted, the property is removed from the symbol's property list.

(get symbol key)

Returns the value associated with key in the property list of symbol. key must be a symbol. If no value is associated with key in the symbol's property list, #f is returned.
Examples:

(put 'norway 'capital "Oslo")
(put 'norway 'continent "Europe")
(get 'norway 'capital)           ==>  "Oslo"

(symbol-plist symbol)

Returns a copy of the property list of symbol as an alist.
Examples:

(put 'norway 'capital "Oslo")
(put 'norway 'continent "Europe")
(symbol-plist 'norway)
   ==>  ((capital . "Oslo") (continent . "Europe"))
(symbol-plist 'foo)              ==>  ()

(symbol? obj)

See R^4RS.

(oblist)

Returns a list of lists containing all currently interned symbols. Each sublist represents a bucket of the interpreters internal hash array.
Examples:

(define (apropos what)
  (let ((ret ()))
    (do ((tail (oblist) (cdr tail))) ((null? tail))
      (do ((l (car tail) (cdr l))) ((null? l))
        (if (substring? what (symbol->string (car l)))
            (set! ret (cons (car l) ret)))))
    ret))
(apropos "let")       ==>  (let* let letrec fluid-let)
(apropos "make")      ==>  (make-list make-vector make-string)
(apropos "foo")       ==>  ()


Markup created by unroff 1.0,    September 24, 1996,    net@informatik.uni-bremen.de