This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: record field name mangling
- From: Per Bothner <per at bothner dot com>
- To: Wen-Chun Ni <wcn at tbcommerce dot com>
- Cc: Kawa List <kawa at sources dot redhat dot com>
- Date: Sun, 26 Jan 2003 19:11:53 -0800
- Subject: Re: record field name mangling
- References: <20030124184443.GA12251@tbcommerce.com>
Wen-Chun Ni wrote:
Seems we can't use names like foo-bar in a record. Take the example
of testsuite, if we use
(define complex (make-record-type "complex" '(re-value im-value)))
(define make-complex (record-constructor complex))
(define z (make-complex 3 4))
(z 're-value)
(z 'im-value)
It will bomb in kawa.lang.Record (line 53 in the current CVS version).
Is this a design constraint or a bug?
It's a bug. I just checked in a patch. Note that it would be
more efficient (as well as more portable) to use record-accessor
(assuming you save the result and re-use it). Even better of
course is to use define-record-type, since that doesn't use
reflection (except for constructors, which is a performance bug).
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/