The function
prompt-for-symbol
prompts the user for a symbol which they should enter into the text input pane.
The symbols that are valid can be constrained in a number of ways.
symbols
, if non-
nil
, should be a list of all valid symbols. The default is
nil
, meaning all symbols are valid.
package
, if non-
nil
, is a package in which the symbol must be available. The value
nil
means that the value of
*package*
is used, and this is the default.
ok-check
is a function which when called on a symbol will return non-
nil
if the symbol is valid.
The prompter is created by passing an appropriate pane (in this case a text input pane) to popup-confirmer. Arguments can be passed to the
make-instance
of the pane and the call to
popup-confirmer using
pane-args
and
popup-args
respectively.
(capi:prompt-for-symbol "Enter a symbol:")
(capi:prompt-for-symbol "Enter a symbol:"
:package 'cl)
(capi:prompt-for-symbol "Enter a symbol:"
:symbols
'(foo bar baz))
(capi:prompt-for-symbol "Enter a symbol:"
:ok-check #'(lambda (symbol)
(string< symbol "B")))