Leopold Toetsch wrote:

Recently on IRC:

@woggle> leo: So, for read-only PMC variants, I'm presuming that it's okay to have the read-only variants have their own type number and type name (like was done for ConstSArray)...

My 2 c:
A distinct type number would cause e.g. different MMD behavior and I'm not sure, if we want to duplicate MMD function code. Letting r/o types subclass the r/w types would change relative distances and also looks suboptimal.

But I don't know yet, how to do it right.

leo

Wouldn't it be an idea to have a property 'is_read_only' or something like that? Then, when attempting to do a write action on a r/o PMC, an exception is thrown. It would seem to me that this is a typical case for using a property.

The disadvantage of course of this approach is that for every write-operation, this check would have to be done, although this is done in fast C code, it *is* yet another check to be done.

My 2c,
klaas-jan

Reply via email to