Re: script object property contamination
Re: script object property contamination
- Subject: Re: script object property contamination
- From: has <email@hidden>
- Date: Thu, 14 Feb 2002 14:14:56 +0000
Anthony Adachi wrote:
>
By the way, believe it or not that was a simplified version of the original
>
code I discovered the original problem (it was a translation of an open
>
source Java testing framework, jUnit, I'm translating into AppleScript).
<swoons> A maniac after my own heart... ;)
>
>Perhaps you could try taking this problem directly to [the AS team]
>
> and see if they'd be willing to look into it?
>
>
I'm not sure if they'd listen as I don't really know if the dynamic handler
>
method is a supported feature of AppleScript.
Handlers are objects in AS (just like everything else), so can be
manipulated as such. What you do with AS objects is your own business, but
when something breaks that's the AS team's business. I do recommend putting
in a bug report - it can't do any harm, and might do some good.
>
>Yep. Did you read my first post, which theorised as to why this was
>
>happening?
>
>
Yes I did but I'm not sure whether I agree with it. However, the reason why
>
I didn't respond to that earlier message is that I don't know enough about
>
the inner workings of AppleScript or language design to argue that point.
Neither do I, but given what little I know about 'real programming' it
seemed a sensible guess.:)
>
As far as I know AppleScript is not statically scoped but it is a dynamic
>
bound language. It's not like Java where at compile time the compiler looks
>
for the object and method you desire to invoke (if neither exists Java will
>
throw a compiler error).
There's elements of both. A trawl through the archives would no doubt throw
up more than a few gems c/o Scott Norton on this subject. [Wondering where
Scott is right now anyway... this sorta thread should be right up his
street.]
>
Since the similarities and differences between globals and properties, in
>
the context of script objects, is so complex I've often had a hard time
>
sorting them out.
I'm sure you'll have read it already, but a quick buzz through pages
311-323 of ASLG covers this topic pretty thoroughly. And, yes, there are
differences in how globals and properties get scoped.
>
It would be nice if the official "horse's mouth" would let the word be
>
known at some point with regards to dynamic handlers. Since it appears to
>
be a thus far officially undocumented feature.
IMO there's a great deal of stuff in AS that can be described as
"undocumented features". It's unfortunate that the available literature
doesn't seem to go much beyond basic language features and application
control, because there's all sorts of cool and interesting things you can
do with AS... if only you happen to know of them.
Cheers,
has
p.s. Go take a shufti at my <ahem> 'website' (hell, it be nice if somebody
did;p)
http://www.barple.connectfree.co.uk/ if you're interested in seeing
some of the nice (if occasionally bizarre) code tricks I've been playing
about with. I just posted b1 of my no.2 date-formatting library, dateLib,
and it does a fair bit chucking around of handlers (though not between
script objects) which should be right up your street.
_______________________________________________
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.