Re: Interesting... AppleScript X ??
Re: Interesting... AppleScript X ??
- Subject: Re: Interesting... AppleScript X ??
- From: has <email@hidden>
- Date: Thu, 26 Sep 2002 10:38:21 +0100
Simon Topliss wrote:
>
Just received my copy of Adobe Illustrator Scripting by Ethan Wilde and in
>
the Acknowledgments section he thanks the AppleScript team at Apple and goes
>
on to state:
>
>
"I can't wait to get my hands on AppleScript X, a fully-object-oriented and
>
re-engineered version of the AppleScript language - coming soon to a Mac
>
near you."
>
>
Looks like there are big plans for AppleScript!
No doubt. Having Perl, Python, Ruby, etc. bundled as standard is very nice
and all, but nothing beats having some unique intellectual property under
one's belt to really stand out from the crowd. I'll be interested to see
just what they do come up with. I'm sceptical that they can do a really
good job without changing a bunch of existing stuff (which means we'll all
have to rewrite a whole bunch of our scripts to get them to work again),
but if they do bite this bullet then more power to them and it'll
definitely be the right choice for the future.
-------
I'm _extremely_ curious what's meant by "fully object-oriented" though.
AppleScript already is OO all the way down: no primitives, etc; everything
is an object. The paradox is that it spends a lot of time deliberately
_hiding_ its OO nature under a procedural-like veneer. Hence you've got
separate commands [verbs/functions] and objects [nouns], and you typically
pass an object to:
duplicate (folder "foo" of disk "frank")
rather than:
tell (folder "foo" of disk "frank") to duplicate
Although the second [OO] form does also work perfectly well. [1]
None of which is any big shakes, except that AS then completely drops the
ball by failing to tell you in the documentation [dictionaries] which
commands work on what objects: the user is generally left to work this out
for themselves (yuk).
--
So I wonder if Ethan means that AS is finally coming out from the closet,
and acknowledging that objects in AS really do have these things called
methods about them, and encouraging users to use them rather than the
current approach (which I'm not sure are any particular advantage beyond
confusing the heck out of folk further down the road).
The one thing I really hope it _doesn't_ mean is that the language itself
has developed some traditional class-based approach to OO programming [i.e.
writing your own OO code using AS] in order to appeal more to the
traditional C++/Java/Python set. I _really_ like its prototype-style of
doing things (a-la Self/JavaScript) despite it currently being
feature-light and less than industrial strength. But lots of potential
there, and much more fun than having dull, dull, dull classes everywhere.
Cheers,
has
-------
[1] Also, this:
tell "abcde" to count
and this:
count of "abcde"
are also valid as OO-ish alternatives to the common, procedural-ish 'count
"abcde"' syntax. [1a]
BTW, bizarrely, the compiler seems to trip up on the following syntax for
no adequate reason:
"abcde"'s count -- compiler error: "I am too stupid to understand this"
But then, it also screws up on stuff like:
if count "abcde" is 5 then beep
So maybe all they're doing is fixing that wretched compiler so it can
finally understand correctly a syntax designed using far more white space
and fewer parentheses than was ever considered natural or healthy for a
programming language...;)
[1a] Which is itself, I suspect, turned into a method call on the object by
a compiler wiggle, rather than a genuine function sitting in the
AppleScript object just waiting to be called; i.e. while a handler
definition like 'on count x | beep | end count' compiles okay, it doesn't
actually seem to do anything. (Contrast with 'log', which clearly _is_ a
function call, supported in the base AppleScript object and overrideable
within scripts or applications.) No wonder "real" programmers find AS so
confusing! ;p
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.