Retrocomputing Asked by OldCurmudgeon on February 22, 2021
I clearly recall working with an object-oriented C derivative on the Mac but I cannot find any definitive references to it.
It was back in the days of System 7 and later System 8. It had both constructors and destructors and, I think, method overloading.
One of its elegant features was the ability to define an object which could be put on the stack (yes, the object was pushed, not its reference) which could capture a current state during construction (getGWorld()
rings a bell) and could automatically revert the state to its original on destruction when the method returned. This ensured that all changes to the state were reverted automatically on method exit, kind of like a modern finally
clause.
I think it was called object-C
and I think it might have been a Symantec
product.
This sounds like THINK C, originally known as Lightspeed C and eventually acquired by Symantec. It included object-oriented extensions to C, with single inheritance added to struct
in particular, and provided a class library wrapping the Macintosh UI. This MacTech review gives a decent summary of the features (before THINK was extended to support C++ and became Symantec C++).
Many of the “nice” features of the object-oriented C model used here weren’t specific to THINK C and can be found in other systems using C; for example, struct
instances can be declared on the stack, and can contain function pointers. Making them nice to use in practice does require extensions though.
Correct answer by Stephen Kitt on February 22, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP