This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Print form for classes?
- From: Chris Dean <ctdean at sokitomi dot com>
- To: Kawa List <kawa at sources dot redhat dot com>
- Date: Sun, 13 Jun 2004 13:36:09 -0700
- Subject: Print form for classes?
What's a good default print form for classes? We have a macro called
define-bean that is a wrapper around define-simple-class. define-bean
creates a new class and (among other things) automatically makes a
toString method. My question is: what's a good default for that method?
Right now we print it out as a vector:
#|kawa:10|# (define-bean <Foo> () (a) (b init: 9) (c init: "hello"))
#|kawa:11|# (make <Foo>)
#(<Foo> a: #!null b: 9 c: "hello")
which isn't great. We could also print out the code that would recreate
the instance:
#|kawa:17|# (make <Foo>)
(make <Foo> a: #!null b: 9 c: "hello")
Which is better? Can anyone think of a good third solution?
Regards,
Chris Dean