Hi there,

afaik "Array" is inherited from "Object" that way, that there are only some 
convenient functions around "Object", but the array is build up with 
"key-value"-pairs just like an "Object-children list" is too. So "length" just 
returns the key with the highest value +1.

a = new Object;
a.foo = "bla";

a["foo"] -> "bla";

b = new Array;
b[0] = "blabla";

b["0"] -> "blabla";

I think the only problem with the Object of the inputNumber[] inputs is, that 
it should be created like an array. But it is created like a structure. So we 
are actually dealing with a structure when we accessing a certain value of the 
inputNumber-"Array".

File a bug?

best,

Achim Breidenbach
Boinx Software



On 22.09.2010, at 05:30, Christopher Wright wrote:

>> This also returns "object":
>> typeof(new Array())
>> As does this:
>> typeof([0, 1])
> 
> 
> Interesting -- good observation.  I thought I remembered array being a 
> specific type, but it looks like I'm mistaken.
> 
> This is unfortunate, because "object" is also the catch-all for any bridged 
> object as well, so it's not very informative at all.
> 
> One thing I did notice while poking about this is that you can do 
> typeof(inputNumber[x]), and you'll get "number" for elements 0 and 1, and 
> "undefined" for 2 and others.  While that feels super fragile and perhaps not 
> directly applicable to what you're trying to solve, it might be an 
> intermediate solution.
> 
> Just to be clear:  this doesn't work because QC doesn't implement a complete 
> bridge with its interface objects -- when properties "0" and "1" are 
> requested, it returns elements from the array as expected.  When the property 
> "length" is requested, it doesn't know what to do because that's not an index 
> (pretty much the only thing it can handle) -- in the debug log on the viewer, 
> you can see the line "length: Unknown property" printed to indicate that 
> failure.
> 
> --
> Christopher Wright
> [email protected]
> 
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/achim%40boinx.com
> 
> This email sent to [email protected]

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

This email sent to [email protected]

Reply via email to