[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Type-checking structure references
- To: Robert.Frederking@CMU-CS-CAD.ARPA
- Subject: Type-checking structure references
- From: Carl Hoffman <CWH@SCRC-QUABBIN.ARPA>
- Date: Thu, 23 Aug 84 22:30 EDT
- Cc: Alan@MIT-MC.ARPA, Common-Lisp@SU-AI.ARPA, Guy.Steele@CMU-CS-A.ARPA
- In-reply-to: <FAHLMAN.12041780645.BABYL@CMU-CS-C.ARPA>
Alan Bawden's version of defstruct has a feature whereby you can define new
types from which to build structures, which can then be used as arguments to
the defstruct :type option. You do this by telling defstruct how to
construct, read from, and store into these types. So you could define your
own defstruct type in which (ship-captain foo) turned into
(if (null foo) nil (svref foo 7)) or whatever. Unfortunately, the defstruct
:type option in Common Lisp is not extensible.