[squeak-dev] final methods

Marcel Taeumel marcel.taeumel at hpi.de
Mon Mar 4 16:49:18 UTC 2019


Hi Subbu,

you cannot. :-) That's a good thing.

As you mentioned, you can document the specific role of a particular method to inform the programmer about side effects. Also, you can add tests that check for such "contracts" in the system. Well, for really dangerous stuff, there might be a hard-coded guard in compiler class. Yet, such guards can easily be overruled by custom compilers.

Best,
Marcel
Am 04.03.2019 02:16:38 schrieb K K Subbu <kksubbu.ml at gmail.com>:
All,


How does one enforce finality of methods in Squeak?

I noticed that methods like Object>>basicSize have instructions in
comments not to override these, but what if these methods do get
overridden/extended during compilation (perhaps by accident or oversight).

Can we use a dummy primitive in these methods to mark them as final?

Regards .. Subbu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190304/ff28fb3d/attachment.html>


More information about the Squeak-dev mailing list