home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!apple!apple!mumbo.apple.com!gallant.apple.com!kip2-36.apple.com!user
- From: jpugh@apple.com (Jon Pugh)
- Newsgroups: comp.sys.mac.hypercard
- Subject: Re: Word 5.1 & AppleEvents
- Message-ID: <jpugh-201192213200@kip2-36.apple.com>
- Date: 21 Nov 92 05:49:44 GMT
- References: <1992Nov11.232622.30978@fourd.com> <7875@lib.tmc.edu> <shebs-171192100253@delos.apple.com> <jpugh-171192132944@wolverine.apple.com> <1992Nov18.171125.12285@waikato.ac.nz>
- Sender: news@gallant.apple.com
- Followup-To: comp.sys.mac.hypercard
- Organization: Apple Computer, Inc.
- Lines: 52
-
- In article <1992Nov18.171125.12285@waikato.ac.nz>, ldo@waikato.ac.nz
- (Lawrence D'Oliveiro, Waikato University) wrote:
- >
- > In article <jpugh-171192132944@wolverine.apple.com>, jpugh@apple.com (Jon Pugh) writes:
- > > In article <shebs-171192100253@delos.apple.com>, shebs@apple.com (Stan
- > > Shebs) wrote:
- > >>
- > [comments about the difficulty of supporting AppleEvents omitted]
- > >
- > > I agree with a lot of this, but in addition I would like to point out that
- > > a lot of the design decisions were made for compatibility reasons.
- > > AppleScript would like to be a full OOP language, but it has to be
- > > implemented in non-OOP programs.
- >
- > Why? AppleScript is a language in its own right, right? So how would you
- > embed AppleScript code inside programs written in other languages? It seems
- > to me the natural way would be to store AppleScript sequences (possibly in some
- > "tokenized" or other such "pseudocompiled" form) in resources or suchlike.
- > So why should that have any interaction with the language that the rest of the
- > program is written in?
-
- That's actually the case. AppleScript compiled scripts are stored as
- tokenized data. You can save them to disk as resources or whatever.
- AppleScript itself is a dynamic OOP, but it has to work closely with other
- applications.
-
- The tough portion of AppleScript support is the AE handlers and object
- resolvers. For example, on the NeXT machine they sinply pass object
- references around and you make method calls to that object. You want to
- use the dictionary, call a method of the dictionary object. In our case we
- can't assume that every program is an instantiation of an object. Many of
- the existing base of apps are procedurally programmed. These are a lot of
- the target apps that AppleScript needs to work with. On its own,
- AppleScript is pretty limited. It has no UI. It has no IO. All it has
- are hooks into apps (well, there are OSAX also, which are essentially AS
- XCMDs, and they can have UI elements). So, these app hooks need to be
- procedural and I think that's where a lot of the difficulty arises.
-
- Toss in the OSL and its myriad of handlers for object resolution (these
- also map nicely onto the _idea_ of method calls, but without any real
- inherited code) and you have a hodgepodge of complicated and interconnected
- procedural APIs you have to code to in order to support AppleScript. It
- isn't pretty, but it isn't really that hard either. It's just kind of
- complicated and not well documented yet.
-
- I'm not sure how to make it nicer, but as the code base increases there
- will be a lot more examples and lessons to learn from. Documentation will
- improve. Things will get easier to understand as we all get smarter. ;)
-
- Am I too optimistic, or too realistic?
-
- Jon
-