chicken-hackers
[Top][All Lists]
Advanced

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

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


From: Alaric Snell-Pym
Subject: Re: [Chicken-hackers] define-record, etc. patch to chicken 4
Date: Fri, 13 Feb 2009 09:44:30 +0000


On 13 Feb 2009, at 7:42 am, felix winkelmann wrote:

I'm not sure whether it is a good idea to generally qualify record
tags.


I need some advice for this. What do others think?



I don't know Chicken internals well enough to know if there'd be any
gotchas with existing code or whatnot, but from a general perspective,
I think that, in general, two define-records in different contexts
(eg, modules) should be entirely different entities, even if they
happen to use the same name.

Two records in the same context that use the same name would result in
a minefield of name clashes, but since they're in the same context the
author of that module is responsible for this not happening.

Perhaps a better approach, rather than doing string surgery on
symbols, would be to identify records with a unique address: rather
than a symbol, store a reference to a record-definition object, which
has the symbol in a slot, and perhaps a list of field names for
introspection purposes? Compare it with eqv? and there you go.

ABS

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/?author=4






reply via email to

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