[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Type-checking structure references

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.