chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] type extension ("inheritance") and define-record


From: Thomas Chust
Subject: Re: [Chicken-users] type extension ("inheritance") and define-record
Date: Sun, 17 Jul 2011 18:49:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110708 Firefox/5.0 SeaMonkey/2.2

Pedro Henrique Antunes de Oliveira wrote:
> [...]
> The fine thing about it is that I only need to use set-replacers! on
> the interface generated by define-record. All the procedures that were
> made to work on the base type will work on the derived type too,
> because the bindings were set!.
> [...]

Hello Pedro,

if the original record was defined in a different module than the
derived one, setting those binding from the original module to other
values may not be visible to the original module and other code using
it, depending on compiler optimization settings used when translating
the original module.

So independent of the question whether it is good style to do this, it
may be unreliable.

In my opinion, the functionality of extensible types would really belong
into the base language, records should be tagged with type objects
instead of symbols and extension of a record type should not introduce
an additional level of indirection on access. But that's a different set
of topics.

Ciao,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.



reply via email to

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