Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!boulder!gore!jacob From: jacob@gore.com (Jacob Gore) Newsgroups: comp.object Subject: Re: True OOP using plain C Message-ID: <1130008@gore.com> Date: 7 Feb 90 05:43:26 GMT References: <406@wmt.UUCP> Reply-To: jacob@gore.com (Jacob Gore) Organization: Gore Enterprises Lines: 49 / comp.object / mist@wmt.UUCP (Michiel Steltman) / Feb 5, 1990 / CO2 looks interesting, but I don't see any major differences between it and Objective C. For example: > Objective C solves some of the problems but has the drawback > that it is not available on all computers and needs special > pre-processing. I suppose "special pre-processing" means compiling those parts of a program that are in the Objective C language but not in the C language into C code. For instance, converting [rectangle moveBy:1.0 :2.0] into something like _msg(rectangle, "moveBy::", 1.0, 2.0) and so on. If that's what was meant, that's certainly true---Objective C is a different language than C, you can't just run an Objective C program through a C compiler. But: > How is this CO2 used? It is very easy to use Co2, it is just > like normal C and it consists of standard libraries with > methods and a program called SYNTOR. Doesn't Syntor also perform "special pre-processing" on a CO2 program? > This results in the fact that all messages 'new' end up in the > same procedure. Syntor generates a C file that contains all > these procedures and dispatches the message to the correct > method. A method is very easy to write, the only speciality > is that an instance method should start with om_ and a > factory method with of_, followed by the class and message > name. The dictionary implementation of atPut is thus: > om_Dictionary_atPut. If I understand this correctly, both the message calls and method declarations require conversion by Syntor into C. Message calls may look like C function calls, but they have to be replaced with a call to something very similar to Objective C's _msg routine. Similarly, Syntor handles method declarations differently than a C compiler handles function declarations (otherwise I don't understand why you need the naming convention). Is this not "special preprocessing"? So, what exactly are the fundamental differences between CO2 and Objective C? Jacob -- Jacob Gore Jacob@Gore.Com boulder!gore!jacob