10

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.

3
  • 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, 2018 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, 2018 at 19:57
  • 3
    @wizzwizz4 and first popularised by NeXT! May 22, 2018 at 20:15

1 Answer 1

12

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 agree to our terms of service, privacy policy and cookie policy

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