> Would _in be a pointer to Input[i] or a structure in it's own right? 

It's a pointer to the original object.  If it's a number, you get a copy, 
anything else you get a pointer to the original (I think?  It's been ages since 
I've poked at this detail).

>> _in and Input[i] (which are the same thing) are JS objects.  More 
>> specifically, they're structures (you're passing in a structure of 
>> structures).
> 
> Typically I use
>               _in = meta_data [i][j] // A tidier way to get to it's items. So 
> then:
>       _in = new Object();
>       _in.alpha = startValue;
>       _in.delta = distance;
> 
> Then I expect to find the values I assigned in meta_data object.

why would you expect that?  you're redefining the object on the second line 
(_in = new Object()  literally means "I no longer care what _in held.  I don't 
care about its hopes, its dreams, its current values, or anything.  if I've got 
the last reference to it, you can even garbage collect it for all I care.  I 
now want _in to be a completely new object, totally separate and unrelated to 
its current state").

This is exactly equivalent to erroneously expecting the following:

x = 42;
x = 21; // new Object()-esq.
x += 2; // I expect X to equal 44 because it was 42 once?


> Is there a sure way to know when I'm making a pointer variable and when I'm 
> copying a value. Obviously structures can't be assigned with just a = 
> my_struct so I'm going to get a pointer in those cases but what if I'm not 
> sure what's in my_struct.Is there a way to test to see a variable is a 
> pointer or not?

use a recursive descent clone function:

http://my.opera.com/GreyWyvern/blog/show.dml/1725165


--
Christopher Wright
christopher_wri...@apple.com



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to