record field name mangling

Per Bothner per@bothner.com
Mon Jan 27 03:19:00 GMT 2003


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/



More information about the Kawa mailing list