Chris Dean <[EMAIL PROTECTED]> writes:
> Can you pick your a favorite utility and give an example of a clean
> spec for it?
SPLIT-SEQUENCE as in the library by the same name. WITH-UNIQUE-NAMES
on Cliki and elsewhere, and as a tolerable half-way house points
(YMMV) I'd offer Osicat with all its limitations (watch it, though, a
cleaned up version using CFFI instead of UFFI and working with SBCL on
Windows is due sooner then later), and WHEN-LET from my own local
library:
syntax WHEN-LET ((var init-form)*) declaration* form* => result*
Evaluates each INIT-FORM in turn until one of them returns NIL as
its primary value, in which case execution of WHEN-LET terminates
and NIL is returned as RESULT.
If no INIT-FORM returned NIL then the primary return value of each
is bound to the corresponding VAR, and FORMs are evaluated as an
implicit PROGN within the scope of these bindings.
(Actually, looking at this again, I think this pretty much fits
the bill. The language could be slightly better, but I can't offhand
see a problem with it -- but maybe someone else can. It is far harder
to see the loopholes in your own thinking and writing then someone
else's.)
I'd also invite you to compate the package lock specifications between
SBCL and Allegro. (Though last I looked at Allegro docs was 7.something,
so maybe they have been tightened up since then.)
Arnesi has both good and bad examples, and CL-UTILITIES mostly good.
CLOCC is full of bad examples. Most of the utilities (and the apis
themselves) in ediware are well-specified. (This paragraph all from
memory, so take it with a grain of salt.)
Of course, the Hyperspec is a prime example of good stuff, with the
exception of pathnames and a few other outliers.
The CLIM spec is a shining example of another large "pretty good"
spec. I'm not a CLIM-hacker, but I understand it is quite
implementable, though some cases are underspecified.
The acid test of a good spec is implementability: will two different
implementations, done by different groups of people, be compatible?
(Of course, when the more trivial the utility, the more trivial the
spec: verbosity is not a criterion, but clarity and comprehensivity
is.)
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."
_______________________________________________
Gardeners mailing list
[email protected]
http://www.lispniks.com/mailman/listinfo/gardeners