[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] indexOf behavior



Ah, I see...
Thanks to all

-a-

On 9 May 2009, at 15:56, Josh Parmenter wrote:

and this (by the way) is because the arrays are different instances of Array objects, therefore not the same identity.

Josh

On May 9, 2009, at 6:18 AM, Sergio Luque wrote:

Hi Andrea,


On May 9, 2009, at 2:17 PM, Andrea Valle wrote:
y = [ [\the, \symbol], \collection, \contains, \my, \symbol ];
y.indexOf([\the, \symbol]);

Returns nil.
Shouldn't it return 0?

.indexOf tests for identity, not equality. Try .indexOfEqual:

y = [ [\the, \symbol], \collection, \contains, \my, \symbol ];
y.indexOfEqual([\the, \symbol]);



Cheers,

Sergio

-- 
Sergio Luque
www.sergioluque.com





_______________________________________________
sc-users mailing list


******************************************
/* Joshua D. Parmenter

“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono
*/


_______________________________________________
sc-users mailing list


--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--------------------------------------------------
" This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a lotta what-have-yous." 
(Jeffrey 'The Dude' Lebowski)