Re: Unwinding the containment hierarchy of a reference
Re: Unwinding the containment hierarchy of a reference
- Subject: Re: Unwinding the containment hierarchy of a reference
- From: Christopher Nebel <email@hidden>
- Date: Tue, 7 Dec 2004 21:42:35 -0800
On Dec 7, 2004, at 7:32 PM, Sander Tekelenburg wrote:
What I cannot envision though is a practical application for [parsing
an object specifier] :) Exactly
when do you deal with an object whose parents you do not know but need
to know? Would anyone care to post an example please?
Well, I mentioned that this had come up earlier today, so here's how it
did:
You can think of a bookmark in Xcode as essentially an object
specifier: characters 42 through 137 of file reference "Foo.m" of
project "Potrzebie", say. (In reality, they also have a name, but
that's not important here.)
The engineer I was discussing this with thought it might be useful to
be able to go to the same location in a different file -- say you had
two data files with similar formats but different contents. Given a
bookmark to the right location in one file, how would you do this? If
you could parse object specifiers, you could tear off the 'characters
42 through 137' part of the original bookmark, and then compose it with
'file reference "Bar.m"', giving you 'characters 42 through 137 of file
reference "Bar.m"'. Presto!
This is not the parentage question originally asked, but it is a use
for specifiers as decomposable objects.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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