Re: when to use "copy" vs "set" [was Re: Manipulating text]
Re: when to use "copy" vs "set" [was Re: Manipulating text]
- Subject: Re: when to use "copy" vs "set" [was Re: Manipulating text]
- From: has <email@hidden>
- Date: Sat, 26 Sep 2009 20:12:21 +0100
Doug McNutt wrote:
>Note, however, that from the AppleScript user's point of view, all
of this is - or should be - *completely irrelevant*.
SNIP
The *completely irrelevant* used above makes me think of an easy fix:
What if the script editor automatically placed an asterisk in front
of users' names for things that are really references to an object?
C semantics are not applicable to the AppleScript language, and you
will only confuse yourself by trying to think about AS in such terms.
Smalltalk sematics would be a better match.
If you're coming from a C background, I suggest you ignore the extra
twist regarding the way that AS integers are represented internally,
and just think of all AppleScript objects as heap-allocated structs.
And then ignore this completely, because it is totally irrelevant to
how you use the language as a scripter.
As far as thinking about AppleScript from the POV of an experienced
programmer:
- All data is represented as first-class objects.
- Some types of objects are mutable, others are immutable.
- Variables are names bound to objects.
- Parameters to a command are passed by value.
(And is the term reference really something else?)
An AppleScript reference object - if that's what you mean - is a first-
class query, vaguely analogous to, say, an XPath query. No relation to
a C pointer whatsoever (and thank goodness for that; pointer semantics
have no place in very high-level languages).
If you want C semantics, use C. If you want AppleScript semantics, use
AppleScript. Either way, you need to understand and use the language
on its own terms.
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden