Re: does property exists in a record
Re: does property exists in a record
- Subject: Re: does property exists in a record
- From: Timothy Bates <email@hidden>
- Date: Tue, 14 Aug 2001 11:50:26 +1000
On 13/8/01 11:51 PM, "email@hidden" <email@hidden> wrote:
>
Associative data structures ... would allow a filter reference form:
>
get every item of myStruct where its a is "Bob"
Definitely: whose clauses everywhere, including lists.
>
Any data type could be the 'index' rather than just a string
This would make AppleScript's Arrays more powerful, but may be rather slow.
I would have to think about this one. It sounds good at first blush, and may
well be a real insight. I have become amoured with the Unix model of
treating everything as a string (file = string, directory=string,
command=string, ...), but with AppleScript's ability to coerce values, your
idea may be a good one.
>
[Let's have]
>
every item of myStruct where its name contains "Bob" and it age > 42
Well, while this is no longer an associative array (you are now looking at
records), I agree that records should support clauses also.
Not to do so was an oversight in the initial design of AppleScript, which,
apart from text, left clause support up to the app (where AppleScript's
designers thought all the work was going to be done anyhow - not realising
how powerful AS was in its own right. I recall reading in the "HyperTalk
2.0: The Book" how few people at Apple believed that maybe a few hundred
script professionals would ever write a HyperCard script - then they were
blown away when academics and artisans around the world started writing
scripts by the 10s of thousands!
tim