This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: macro for record definition


Stan Pinte wrote:

> would someone have contributed a macro, enabling to define in one shot 
> a constructor, and all the accessors for the slots of a record,
> to get rid of the use of functions like:
>
> make-record-type, record-constructor, ...
>
> I would like to have such a macro, to which I can pass the record 
> name, the record slots, and this macro would expand to a definition of 
> all the accessors, of a constructor, of the record-precidate, ...

First, I recommend against make-record-type and related functions, if 
you can
conveniently use one of the alternatives, because they create new 
classes at run-time,
and require runtime reflection.  That is why I would not accept any 
addtion to Kawa
that depends on make-record-type.

My preference is to build on define-class syntax.  The plan is that this 
will support most
of the features of CLOS or GOOPS (a CLOS like OO system used in Guile). 
 It should
be possible to write a macro like you want.

What I would like is to add an implementation of SRFI 9 "Defining Record 
Types"
(http://srfi.schemers.org/srfi-9/srfi-9.html).  This can be implemented 
on top of
make-record-type fairly easily (the SRFI 9 document provides an 
implementation),
though it would be better to define it using define-class.  That should 
not be very
difficult




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]