>>>> "Kyle" == Kyle Jones
<kyle_jones(a)wonderworks.com> writes:
Kyle> Adrian Aichner writes:
> Doing it right (following Kyle's suggestion) would in this
> particular case lead to awkward code bloat compared to the
> version before Yoshiki's patch.
How can "doing it right" (your wording ;) be WRONG? :-)
Kyle> I think we should get used to using and seeing code like
Kyle> this. Otherwise we'll never use new API features in the
Kyle> packages.
Having seen Kyle's explanation of how it works, I don't have trouble
reading that code.
In fact, most such code is going to be very stylized (drop the last
few arguments). One possible solution would be to create a
`backwards-compat' package that would provide wrappers for such
functions (I don't know how to code this offhand so I'm not giving
examples) that (1) somehow transfers the current definition of (eg)
#'completing-read to someplace it can be found (maybe a property of
'completing-read?) and (2) redefines #'completing-read to call the old
definition inside a condition-case of the stylized form.
If this was done as a macro (I think it could easily be), functions
whose APIs changed in incompatible ways would stand out like a sore
thumb because the macro wouldn't be used.
Then a package would simply do
(unless (>= emacs-version api-version-package-uses)
(require 'backwards-compat))
at load.
New code bears very little burden. Old code doesn't break, it just
runs slow enough that the users demands an upgrade ;-)
And the `backwards-compat' package itself would thus document API
changes.
What do you think?
--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
_________________ _________________ _________________ _________________
What are those straight lines for? "XEmacs rules."