Re: list question
Re: list question
- Subject: Re: list question
- From: Gary Lists <email@hidden>
- Date: Tue, 03 Jun 2003 18:18:38 -0400
On or about 6/3/03 5:31 PM, Doug McNutt wrote:
>
At 13:37 -0700 6/3/03, Chris Page wrote:
>
> I've always found the ASLG's description of "sharing" a little confusing and
>
> overly complicated, especially since it treats some objects as "shared" and
>
> not others. I think a simpler way to look at this is that variables refer to
>
> objects, and some objects are mutable (the object can be changed).
>
SNIP
>
>
I am also confused.
>
>
I would really appreciate a description of the whole idea in language I can
>
understand. Like,. . .
>
>
Where are the items stored? What is the "pointer" to the damned stuff?
>
>
What is the format of the items? Is it null-terminated C strings? Or something
>
else? Yes. You want to abstract it but doing that requires pages of lawlerly
>
documentation which Apple simply doesn't provide. Isn't it better to just
>
provide a snapshot of what it is as of today? Can you say "show the source
>
code?"
>
>
Computers have memory. Each item stored in memory has an address. The
>
microprocessor knows about addresses. It even knows about virtual addresses
>
that really reside on a disk somewhere but will be reloaded into RAM as
>
required.
>
>
I really think I understand "objects" in the sense that they are collections
>
of information stored at an address in memory. Why in the Devil are they so
>
obfuscated in "modern" programming languages like AppleScript? What are the
>
SIMPLE FACTS about the whole mess?
>
>
I'm, sorry. I understand electrical engineering. I know about electrons in
>
wires. Electrons obey SIMPLE laws. (Well they are differential equations that
>
use exponents which Applescript doesn't understand.) Why in Hell do languages
>
like AppleScript purposely obfuscate those SIMPLE things? It makes life most
>
difficult for users who just want to get something to work.
>
>
KISS for ever, dammit.
Andy O's nuts-n-bolts walk through provided a short and direct example of
the difference between 'set' (the OP's code) and 'copy', and then Paul B's
very clear discussion of the class/type differences made the usages widely
applicable. Both very simple and clear...to me. (IMH ?)
I have no idea why you think the electron configuration of the universe, or
your RAM, would be less clear than those posts. ;)
>
I really think I understand "objects" in the sense that they are collections
>
of information stored at an address in memory. Why in the Devil are they so
>
obfuscated in "modern" programming languages like AppleScript? What are the
>
SIMPLE FACTS about the whole mess?
The simple facts were clearly laid out here:
[ Re: list question ],
Paul Berkowitz <email@hidden> :
>
>
Lists and records "share data": i.e. they are dynamic. When you use the
keyword 'set', all variable instances set to the same list or record change
along with the instance you're changing, unlike what happens with strings
and numbers. (Dates are also dynamic.)
To avoid data sharing between instances of lists and records, use 'copy'
>
>
What I got:
KISS: Lists, records and dates are dynamic.
KISS: Strings and numbers are not.
And a clear example was provided here:
[ Re: list question ],
Andrew Oliver <email@hidden> :
>
>
I *think* what
you're trying to do is use b as a copy of the original, then manipulate the
original in which case you want to:
set a to {"a", 1}
copy a to b -- now b is a distinct copy of a
set a's item 1 to "b"
return b
--> {"a", 1}
And a still holds the modified {"b", 1}
>
>
>
What is the format of the items? Is it null-terminated C strings? Or something
>
else? Yes. You want to abstract it but doing that requires pages of lawlerly
>
documentation which Apple simply doesn't provide. Isn't it better to just
>
provide a snapshot of what it is as of today? Can you say "show the source
>
code?"
??
--
Gary
OMM: OS9.1.2 / osa:AS 1.8.3 / osa:JS 1.0.3 / BBE 6.1.2
"9 is Fine"
Please reply directly to the list.
Incoming messages are auto-deleted. (It's anti-spam, that's all.)
Prefer direct? Not a spammer?
Rot me at: email@hidden
_______________________________________________
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.