The function prompt-for-value prompts the user for a form and returns the result of evaluating that form.
The form is read in the
package
if specified or
*package*
if not and the result is the evaluation of the form.
If initial-value is supplied it provides a default form.
If value-function is supplied it overrides the default value function which reads the form and evaluates it.
The prompter is created by passing 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-value
"Square"
:initial-value '(+ 1 2 3)
:value-function
#'(lambda (text)
(let ((res (eval (read-from-string text))))
(* res res))))