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

Re: [sc-users] indexOf behavior



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

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/

******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“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

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/