"Stephen J. Turnbull" <stephen(a)xemacs.org> writes:
>>>>> "Paul" == Paul Krause
<pkrause(a)soundbite.com> writes:
Paul> But widget-field-value-create should protect itself by
Paul> converting value to a string if it isn't one already.
I disagree. The widget functions are quite low-level, and already do
too much of that kind of thing, I think. For example, there are two
immediately plausible ways to convert a symbol to a string
(symbol-value and symbol-name). Hard-coding either one would be
horrible.
I agree with Stephen, changing widget-field-value-create would be
fixing the symptom instead of the cause. The cause most likely being
a bogus defcustom declaration.
However, adding type predicates to parameters in the widget and custom
functions in order to get better error messages might be worthwhile,
if someone is willing to do the work.
The problem is that type errors are caught too late. A systematic
approach to declaring acceptable types for function parameters would
help a lot. In fact, some type errors might even be caught by the
byte compiler!
...
Oops, did I just suggest static typechecking for Lisp?