Forums > MaxMSP

Bug in zl len and Llength with lists of symbols?

December 15, 2008 | 12:04 pm

Hello,

I want to get the length of a list made of symbols. Zl len doesn’t
return the correct length when it is smaller than 2 while Llength
reduces actual length by 1 (but not when actual length is 1).

Please see both objects’s behaviour with symbols and integers in
attached patcher (tested on Mac Intel, Max 5.0.5 + lobjects UB 10_06).

Roald Baudoux

– Pasted Max Patch, click to expand. –

December 15, 2008 | 12:24 pm


December 15, 2008 | 12:45 pm


December 17, 2008 | 10:08 am


December 17, 2008 | 11:14 am

I, too, have stumbled over coll’s ‘symbol’ convention. But after the first time most people get used to the idea.

Someone intimately familiar with the inner workings of the Max engine would need to comment on this, but I suspect the justification for the ‘symbol’ convention was at least in part an efficiency question back in the days of computers with 16MHz clock rates. Those days are gone, and I don’t want to be a backwards-compatibility fetishist, but coll is such a ubiquitous object that changing the default behavior could break something like 90% of the patches in the universe. That’s a lot of pain to obviate the need for a [route symbol] object.

Here’s a present for your Clippings folder:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 103 103 106 196617 route symbol int list;
#N coll foo 1;
#P newobj 103 79 54 196617 coll foo 1;
#P connect 0 0 1 0;
#P window clipboard copycount 2;

Salt to taste.


December 22, 2008 | 10:10 pm


Viewing 6 posts - 1 through 6 (of 6 total)