[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: structure type specifier
From: Christopher Fry <cfry@OZ.AI.MIT.EDU>
STRUCTURE is not a legal type specifier ....
From: Robert W. Kerns <RWK@YUKON.SCRC.Symbolics.COM>
Actually, it doesn't seem "awfully useful & natural" to me.
Natural, yes, but since CLtL doesn't have any primitives
for dealing with structures at all, it doesn't seem incredibly
useful.
Well, I think a standardized way of testing for "structure-hood"
would be quite useful - from time to time I write my own tools for
things like pretty-printing, inspecting complex data structures, etc.
(yes, most implementations have some or all of these, but the tools
aren't standard across implementations, so for portability or to fill
in the gaps in some implementation I sometimes write my own.) I also
tend to write code that uses structures heavily, so my tools have to
deal with them. In all of my tools I continually find myself wanting to
find out if an argument is a structure precisely BECAUSE Common Lisp
doesn't provide primitives for getting inside a structure - knowing
that something is a structure then tells the printer/inspector/etc
that it has to punt (e.g., hope the user provided a decent
:print-function, or something like that). Conversely, of course,
if Common Lisp DID provide generic structure-manipulating primitives then
I would want to test for "structure-hood" in order to be able to
decide whether those primitives could be applied to an object.
In either case I think Common Lisp should provide a "structurep"
predicate, "structure" as a type identifier, etc.