Re: Memory tests
Re: Memory tests
- Subject: Re: Memory tests
- From: Michael Terry <email@hidden>
- Date: Thu, 18 Mar 2004 17:55:06 -0800
On Mar 18, 2004, at 4:16 PM, Nelson Byrne wrote:
1) What's the difference between these two lists?
[a,b,c] and (a,b,c)
2) What is the "best type"? ... or was it "best class"?
The first one is an old 'linked list' type and the other one...isn't a
list. Hahaha!
Anyway, I assume you meant with the curly braces, in which case it's a
'vector' type.
Here is one difference:
set x to [1, 2]
set y to [3]
set z to x & y
set y's first item to 4
z
--> {1, d, 4}
This is not what you'd expect from regular lists. These days, the
linked list type is deprecated; I think vectors must be overwhelmingly
better. However, there may be some cases where the performance
characteristics of AS's linked list implementation win out. I
personally haven't tested this, but R23 implied that he saw advantage
in using linked lists sometimes. He also said something like, "we must
keep some secrets, mustn't we?"
You used to be able to get the type class of a list using the 'best
type' property:
best type of [a, b, c]
--> linked list
but that doesn't work anymore. Now you have to use:
<<class pbst>> of [a, b, c]
--> linked list
Notice also that AS represent either type in the result window with
curly braces, whatever the internal type.
Mike
_______________________________________________
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.
References: | |
| >Memory tests (From: Nelson Byrne <email@hidden>) |