Hello

I am new to CHICKEN scheme and here is a (very) quick question of how to check whether a symbol is bound.

I know it doable but I can't find the way.

I don't find the methods from the main CHICKEN manual document. Then I import the "symbol-value-utils" module. I believe the "unbound?" or "symbol-value" will do what I want, but to my surprise they does NOT:

I expect `symbol-value' will give me value of a symbol, but it will throw exception for an
undefined symbol, even I provide the default value:

(symbol-value foo #f)
Error: unbound variable: foo

I expect (symbol-value (string->symbol "list")) will give me the list procedure, but what I get is '#f'

(symbol-value (string->symbol "list"))
#f

I expect (unbound? foo) will return True value, but it just throw exception.

Does CHICKEN scheme provide facilities that make user check whether arbitrary symbol is bound or get its value, just like the `boundp' or `symbol-value' in Common Lisp?

Thanks
Pan


Reply via email to