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

extending DEFSTRUCT



I agree with Touretzky's proposal, except I would add:

When *PRINT-STRUCTURE* is a non-nil list:
  defstructs whose types are members of the list use their own print function
  defstructs whose types are not in the list use #S()

I think the membership test should be TYPEP, and that :INCLUDEd types
inherit the print function dynamically (with possibility of over-ride,
of course).

I personally prefer to use a macro DEFSTRUCT-PRINT-FUNCTION so that 
I can define the print function separately from the DEFSTRUCT itself,
but I wouldn't go so far as to make that part of CL; rather, let's:

define a GET-PRINT-FUNCTION function (with a SETF form)
  which returns the print function associated with a type.