8

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.

  • getGWorld is from an API/SDK so could have been any language. <strike>Could it have been "object pascal"? - en.wikipedia.org/wiki/Object_Pascal#Early_history_at_Apple </strike> – Joe May 22 '18 at 16:46
  • 3
    For the name, you were probably getting confused with "Objective C" which was for a later OS branded as Mac. – wizzwizz4 May 22 '18 at 19:57
  • 2
    @wizzwizz4 and first popularised by NeXT! – Stephen Kitt May 22 '18 at 20:15
10

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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.