Article View: comp.sys.mac
Article #14522Re: Object Pascal
From: Larry Rosenstein
Date: Thu, 22 Jan 1987 20:53
Date: Thu, 22 Jan 1987 20:53
50 lines
2614 bytes
2614 bytes
In article <4629@mit-eddie.MIT.EDU> djd@eddie.MIT.EDU (Dave D'Souza writes:
>
>I am interested in receiving a little more information about MPW
>Pascal. I know it is an object oriented language but I read somewhere
>(perhaps in this or the o-o languages newsgroup) that Object Pascal
>doesn't allow class definitions. I am curious as to how one creates
>object and methods in this language. Is is somewhat like lisp's
>flavors?
>
Object Pascal does not support class objects or class methods, but does
allow you to define new classes (object types). For example, you can define
a general Shape object type that specifies a certain interface and then
define subclasses of Shape for Rectangle, Circle, etc.
It is possible to write code that sends messages to Shape objects without
knowing if they are in fact Rectangles, Circles, etc. It is easy to create
a new subclass of shape and install it into your program.
For more information on Object Pascal you can look up Kurt Schmucker's book
"Object-Oriented Programming on the Macintosh" (published by Hayden). There
have been articles in the August 1986 BYTE, the November & December 1986
MacWorld, and the Decemer 1986 MacTutor.
Most of these articles talk about MacApp as well as Object Pascal. MacApp
is an application framework written in Object Pascal that uses the
object-oriented extensions. MacApp defines several object types (View,
Document, Command), which the programmer subclasses. Your application
inherits the common Macintosh user interface (windows, menus, DAs, etc.)
from MacApp.
>Source code to a simple example program (it doesn't have to compile)
>would be much appreciated. I just want to know if it is worth
The December MacTutor article that I wrote contained the source code for a
simple game program on the Macintosh. That should give you an idea of what
Object Pascal is like.
--
Larry Rosenstein
Object Specialist
Apple Computer
AppleLink: Rosenstein1
UUCP: {sun, voder, nsc, mtxinu, dual}!apple!lsr
CSNET: lsr@Apple.CSNET
Technical Details
Message-ID:
<398@apple.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!nbires!hao!hplabs!nsc!voder!apple!lsrReferences:
<4629@mit-eddie.MIT.EDU>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!nbires!hao!hplabs!nsc!voder!apple!lsr From: lsr@apple.UUCP (Larry Rosenstein) Newsgroups: comp.sys.mac Subject: Re: Object Pascal Message-ID: <398@apple.UUCP> Date: Thu, 22-Jan-87 15:53:53 EST Article-I.D.: apple.398 Posted: Thu Jan 22 15:53:53 1987 Date-Received: Fri, 23-Jan-87 06:46:47 EST References: <4629@mit-eddie.MIT.EDU> Reply-To: lsr@apple.UUCP (Larry Rosenstein) Organization: Advanced Technology Group, Apple Computer Lines: 50