Data typing question

mattyo's icon

I'm building an abstraction that needs to handle a lot of different
data types, and as we know, if you need a trigger object for anything,
[t l l] will pass any data type through its outlets. The problem is
on the way out. You then cannot use something like [route int list],
because an integer, once it has passed through [t l l], is no longer
an integer, but a one-item long list. See example below:

Max Patch
Copy patch and select New From Clipboard in Max.

It would be nice if there was something like an "anything" value you
could put in a trigger (hint hint), but as there isn't, does anyone
have a handy trick for restoring things to their original data types
(list, int, float, symbol) after getting labeled a list, short of
brute force methods like counting the number of items, testing for
ASCII, and so on? Any ideas welcome.

Thanks all!

M

Chris Muir's icon

I don't understand your use of the trigger object.

What I often do is hang a route off of my inlets so that I can accept
various types, and do the right thing.

Max Patch
Copy patch and select New From Clipboard in Max.

-C

mattyo's icon