While working with Gauche, sometimes you encounter
a value printed as
#<undef>, an undefined value.
gosh> (if #f #t) #<undef>
It is a value used as a filler where the actual value doesn’t matter, or to indicate there’s no other suitable value.
Do not confuse undefined values with unbound variables;
A variable can be bound to
#<undef>, for it is just
an ordinary first-class value. On the other hand, an
unbound variable means there’s no value associated with the variable.
#<undef> may be used in certain
occasions to indicate that a value is not provided for
the variable. For example, an optional procedure parameter
without default value is bound to
#<undef> if an
actual argument is not given (see Making procedures).
Note that it cannot be distinguished from the case
a value is actually provided, and the value just happens
#<undef>. If you get an
you can say at most is that the value doesn’t matter.
You shouldn’t let it carry too much meanings.
Being said that, there are a couple of procedures to deal with undefined values.
#t iff obj is an undefined value.
Returns an undefined value.