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

Re: [Tads3] knowledge / 'seen' / npc knowledge base



Mike Roberts wrote:

> Agreed - that's the usage I had in mind. I'll think about adding it,
> although I'm not sure it would really be justified given the light
> use it would probably see (even counting the space savings and improved
> abstraction). Any opinions on the value of adding this? - in particular,
> does anyone think they'd have a lot of use for it [sc. a Set class]?

Søren J. Løvborg responded:
> I don't think it's worth adding an new metaclass just to save,
> what, 7 bytes per entry?

And Jesse Welton replied:
> The primary reason for it would be that a Set is a better model of a
> set than a HashTable is.  A marginal space savings is just a minor
> side-benefit.  The question is, are sets used often enough (or would
> they be, if available)?  That, I don't know, but they are certainly a
> useful abstraction for many purposes in general programming.

I'm not at all sure I understand all the implications here, but a couple of
points occur to me:

(1)	Presumably there would be some increase in memory requirement from the
increased code size of implementing a new class, which might outweigh a
saving of (say) seven bytes per entry in a little-used class (though I
suppose it might be in a different segment of memory)?

(2)	But if it's likely to be a lightly-used class with a limited range of
specialized uses for which it's the best model, would it be possible or
desirable to implement it in a separate module that's only included in game
code if an author specifically wants to use it?

-- Eric