Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.lisp Subject: Re: STRUCTUREP Message-ID: <3533@skye.ed.ac.uk> Date: 12 Oct 90 14:01:43 GMT References: <753@forsight.Jpl.Nasa.Gov> <27133D6E.715C@marob.masa.com> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 23 In article <27133D6E.715C@marob.masa.com> cowan@marob.masa.com (John Cowan) writes: >In article <753@forsight.Jpl.Nasa.Gov> gat@robotics.Jpl.Nasa.Gov (Erann Gat) writes: >>Is there any way in Common Lisp to test if an object is a structure? There >>doesn't seem to be a structurep function. >No, there isn't, and that's intentional. Some of the Common Lisp standard >types, notably STREAM, READTABLE, RANDOM-STATE, PATHNAME, and PACKAGE >may be implemented using the structure mechanism, but this fact is hidden >from the user. A STRUCTUREP function would be unable to discriminate >between these implementation-defined structures and user-defined ones. So? Is that supposed to be a bad thing (that some built-in types might be structures)? Note that in Common Lisps with an integrated CLOS (which is how they'll probably all be after a while) you *can* find out if a type is a structure. >There's very little you can say about a structure qua structure, anyway. >The names of the {access, constructor} functions aren't deducible from the >outside, given that the default names can be overridden at DEFSTRUCT time. That's why you need more than STRUCTUREP.