>>>> "Paul" == Paul Stodghill
<stodghil(a)CS.Cornell.EDU> writes:
Paul> The current code is broken, definitely. And if tag sets do
Paul> refer to devices, then I think that my patch is ok. But if
Paul> tag sets involve MULE ... <shudder>
No, no. I cannot tell a lie. They don't involve Mule.
There are two things that you need to do (in my off-the-cuff
opinion).
One is when you have a set of functions that manipulate specifiers,
you should anticipate that callers---written by others, possibly in
the future---might want to use tags as well and provide an interface
(eg, an optional argument) to pass a tag set. Then when you call the
specifier functions you do something like
(defun my-func (value &optional tag-set-arg)
(if (intersect tag-set-arg tags-mutually-exclusive-with-mine)
(if this-is-a-disaster
(error "Called with incompatible tags!")
(do-nothing-clean-up-and-exit))
(manipulate-specifier specifier value (cons my-tag tag-set-arg) ...)))
Try to arrange that functions compute what they need to do from a
specifier, rather than using
(cond ((eq tag 'x) (x-do-something ...))
((eq tag 'mswindows) (mswindows-do-something ...))
...)
Specifiers often can do that for you magically.
If you do those two things, then other code written to use specifiers
should pretty automatically work right. Of course, you don't always
need to do them if you're pretty sure they're only auxiliary functions
for your own code; then you should document them as internal,
interface subject to change, please use XYZ instead, etc etc.
Jan claimed (if I read it right) that specifiers are inefficient;
maybe they are. So keep an eye on performance. But specifiers were
designed to do very complex manipulations of these types as
efficiently as possible; doing switching on device type and the like
at the Lisp level should reach decreasing returns fairly early on as
complexity of the condition increases.
--
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 two straight lines for? "Free software rules."