[CM] A question about def-clm-struct

Bill Schottstaedt bil@ccrma.Stanford.EDU
Wed, 4 Dec 2002 04:46:12 -0800

> Does def-clm-struct also allow the types of defstruct options that are
> allowed by defstruct?

No -- sorry; each such option requires Lisp->C translation support.
Currently in CL def-clm-struct piggybacks on the existing array
support.  To add specialized print functions, it needs to register a
new type for the struct, then add an entry to mus_print_object.  You
could get the same effect by defining a macro that does the printing
you want (but, of course, a value like 'baz isn't going to work -- I
don't try to support symbols in any version of the run macro).

(def-clm-struct foo (bar 1.0))
(defmacro print-foo (f) `(clm-print "<hello: ~A>" (foo-bar ,f)))