Quickly scratched this out. It will work with getstring (having or not having optional argument filled), but I couldn't figure out how to get it to eval a list with a point list within. Oh well, it wasn't for a practical purpose and I don't know the solution (not that it matters).
(defun foo (var exprlst iffalse)
(set var
(cond (((lambda (result) (cond ((not (member result (list nil ""))) result)))
(eval
(mapcar
(function
(lambda (x)
(cond ((eq (type x) 'STR)
(strcat x
" <"
(cond ((eq 'STR (type iffalse)) iffalse)
((eq getangle (car exprlst)) (angtos iffalse))
((eq 'REAL (type iffalse)) (rtos iffalse))
((eq 'INT (type iffalse)) (itoa iffalse))
)
">: "
)
)
((listp x) x)
(x)
)
)
)
exprlst
)
)
)
)
(iffalse)
)
)
)
works fine:
(foo 'str (list getstring T "\nSpecify string") "DOG")
errors on the added point:
(foo 'ang (list getangle '(0 0 0) "\nSpecify angle") pi)