chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] define-record, etc. patch to chicken 4


From: Jim Ursetto
Subject: [Chicken-hackers] define-record, etc. patch to chicken 4
Date: Sat, 7 Feb 2009 03:40:54 -0600

define-record, define-record-type and define-record-printer do not
take the module namespace into account, so records that are defined in
different modules--but have the same base name--may conflict, giving
strange results or crashing your program.  The attached patch
qualifies the structure name with the current module name, which seems
to work.

I also provided some REPL output (record-repl.scm) and a compilable
program (record.scm) which will demonstrate the before and after.

If this approach looks good, there are a few eggs which should be
examined because they create structures directly:

records: can be changed to use define-record
unix-sockets: same
datatype: should qualify symbols itself, if desired
easyffi: not sure
numbers: "compnum" unlikely to conflict, but could be qualified

Jim

Attachment: record-rename.diff.txt
Description: Text document

Attachment: record-repl.scm
Description: Binary data

Attachment: record.scm
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]