home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / hypercar / 4269 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  3.3 KB

  1. 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
  2. From: jpugh@apple.com (Jon Pugh)
  3. Newsgroups: comp.sys.mac.hypercard
  4. Subject: Re: Word 5.1 & AppleEvents
  5. Message-ID: <jpugh-201192213200@kip2-36.apple.com>
  6. Date: 21 Nov 92 05:49:44 GMT
  7. 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>
  8. Sender: news@gallant.apple.com
  9. Followup-To: comp.sys.mac.hypercard
  10. Organization: Apple Computer, Inc.
  11. Lines: 52
  12.  
  13. In article <1992Nov18.171125.12285@waikato.ac.nz>, ldo@waikato.ac.nz
  14. (Lawrence D'Oliveiro, Waikato University) wrote:
  15. > In article <jpugh-171192132944@wolverine.apple.com>, jpugh@apple.com (Jon Pugh) writes:
  16. > > In article <shebs-171192100253@delos.apple.com>, shebs@apple.com (Stan
  17. > > Shebs) wrote:
  18. > >>
  19. > [comments about the difficulty of supporting AppleEvents omitted]
  20. > >
  21. > > I agree with a lot of this, but in addition I would like to point out that
  22. > > a lot of the design decisions were made for compatibility reasons.
  23. > > AppleScript would like to be a full OOP language, but it has to be
  24. > > implemented in non-OOP programs.
  25. > Why? AppleScript is a language in its own right, right? So how would you
  26. > embed AppleScript code inside programs written in other languages? It seems
  27. > to me the natural way would be to store AppleScript sequences (possibly in some
  28. > "tokenized" or other such "pseudocompiled" form) in resources or suchlike.
  29. > So why should that have any interaction with the language that the rest of the
  30. > program is written in?
  31.  
  32. That's actually the case.  AppleScript compiled scripts are stored as
  33. tokenized data.  You can save them to disk as resources or whatever. 
  34. AppleScript itself is a dynamic OOP, but it has to work closely with other
  35. applications.
  36.  
  37. The tough portion of AppleScript support is the AE handlers and object
  38. resolvers.  For example, on the NeXT machine they sinply pass object
  39. references around and you make method calls to that object.  You want to
  40. use the dictionary, call a method of the dictionary object.  In our case we
  41. can't assume that every program is an instantiation of an object.  Many of
  42. the existing base of apps are procedurally programmed.  These are a lot of
  43. the target apps that AppleScript needs to work with.  On its own,
  44. AppleScript is pretty limited.  It has no UI.  It has no IO.  All it has
  45. are hooks into apps (well, there are OSAX also, which are essentially AS
  46. XCMDs, and they can have UI elements).  So, these app hooks need to be
  47. procedural and I think that's where a lot of the difficulty arises.
  48.  
  49. Toss in the OSL and its myriad of handlers for object resolution (these
  50. also map nicely onto the _idea_ of method calls, but without any real
  51. inherited code) and you have a hodgepodge of complicated and interconnected
  52. procedural APIs you have to code to in order to support AppleScript.  It
  53. isn't pretty, but it isn't really that hard either.  It's just kind of
  54. complicated and not well documented yet.
  55.  
  56. I'm not sure how to make it nicer, but as the code base increases there
  57. will be a lot more examples and lessons to learn from.  Documentation will
  58. improve.  Things will get easier to understand as we all get smarter.  ;)
  59.  
  60. Am I too optimistic, or too realistic?
  61.  
  62. Jon
  63.