decompilation insanity
decompilation insanity
- Subject: decompilation insanity
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 19 Oct 2005 16:34:29 -0400
Okay, if I type into the Script Editor:
set homeDir to posix file "/Users/mreed"
(at this point many of you already know what's coming) it magically transforms into
set homeDir to file "Macintosh HD:Users:mreed:"
and succeeds; the result is displayed as
file "Macintosh HD:Users:mreed"
If I then cut the line I'm looking at in the source and re-paste it exactly as is, I get a compilation error.
Matt's book explains this behavior on page 252: you can't set a
variable to a file object directly; you have to go through a reference.
OK, so how come it worked the first time? Still on page 252, it
turns out that what "posix file" compiles into is not really a file
object (class "file") but a file URL object (class "furl").
So why does it decompile as "file"?
Well, I guess that's a multipart question:
1) why are objects even allowed by the language to decompile into forms that don't compile back to the original objects?
If the answer to (1) is "because it's too hard to verify that they don't", then
2) why does the Script Editor replace what I type with the decompiled version since that's not guaranteed to work?
Finally,
3) regardless of the answers to the above, why, oh why, did the AS folks design file, posix file, and file url this way?
Okay. The ranting and raving portion of this email message is now
complete. Moving on, I believe that the upshot of all this is
that I am ready to use something better than Script Editor. I'm
looking for a tool which will grant me more control over
(de)compilation and poke and prod at the innards of objects. What
are your recommendations?
Script Debugger? Smile? What's free, what's not? Pointer to a past discussion in the archives is fine.
Thanks.
--
Mark J. Reed <
email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden