From ... From: Erik Naggum Subject: Re: Learning programming languages Date: 1999/07/23 Message-ID: <3141719665059907@naggum.no>#1/1 X-Deja-AN: 504372443 References: <80C621FFC2DFD2119FFF00805FA7C54F034E8D1D@exchange1.hhmi.org> mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * Tim Bradshaw | For most purposes (people will disagree...) you can think of classes as | simply the representation of types in the language: every class | corresponds to a type, every object has a class. | | Before CLOS it was already possible to add new types to the language, and | to define them as `subtypes' (subclasses, really...) of other types -- | not for all types, only for `structure' types. Tim, don't set the guy up for even more confusion than he "deserves". _types_ in Common Lisp are orthogonal to classes, and have nothing at all to do with subclasses. e.g., the types BOOLEAN or KEYWORD, both of which are only partitions of the value space of the class SYMBOL, or FIXNUM and BIGNUM, which are but partitioning the value space of the class INTEGER. of course, a type can exhaustively cover the value space of a class, but that is trivial. e.g., (SIMPLE-VECTOR (SIGNED-BYTE 32) (128)), objects of which type would still be instances of the system class VECTOR. (no, there is no _class_ named SIMPLE-VECTOR, nor classes for all specialized vectors, but STRING and BIT-VECTOR are exceptions to this rule. sorry for the pedantry. ;) | You can dispatch on *any* Lisp type (as you could before if you wanted | to). this is false. you can only dispatch on classes in CLOS. #:Erik -- suppose we blasted all politicians into space. would the SETI project find even one of them?