[PD-dev] mystery type generated by [list trim]

Frank Barknecht fbar at footils.org
Sun Oct 29 13:38:38 CET 2006


Hallo,
Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:

> That might be one solution when using [list trim], but this example  
> actually shows a problem with the type system.  Things are supposed  
> to be strictly typed, atoms are either floats, symbols, or pointers.   
> This is an example of an atom that is none of the above.  That should  
> not happen, its a bug somewhere.
> 
> I updated the example patch with a couple of more relevant examples:

The mystery type "symbol atom with numeric content" cannot be dealt
with in Pd like this yet, because you cannot really input this mystery
type in Pd: Every numeric value in an object box will be converted to
a float atom, you have to generate a symbol-atom with numeric content
through other means like makefilename. 

That's why [select 1234] fails to detect a "1234"-symbol without
selector. [select 1234] will generate a [select] object in "float
mode". [select something] will generate a [select] in "symbol mode".

The float-[select] only has methods for float- and symbol-messages,
but no methods for meta-messages like "set a b c", "set" or the
"1234"-mystery-symbol.  (It also has no methods for bang-message and
"list a b c"-messages will generate an error message, but at least
works.)

Similar things happen with [route 1234]: This route waits for a "float
1234" but in your example it gets a symbol-atom "1234" and correctly
passes it along to the miss-outlet.

See attached example for this illustrated.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 416 116 775 458 10;
#X msg 65 79 1234;
#X obj 20 285 print;
#X obj 66 245 list trim;
#X floatatom 113 309 5 0 0 0 - - -;
#X symbolatom 161 308 10 0 0 0 - - -;
#X obj 66 329 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 -1
-1;
#X obj 66 285 route bang float symbol list;
#X obj 113 329 bng 15 250 50 0 empty empty float -4 23 1 12 -262144
-1 -1;
#X obj 161 329 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144
-1 -1;
#X obj 209 329 bng 15 250 50 0 empty empty list -2 23 1 12 -262144
-1 -1;
#X obj 257 329 bng 15 250 50 0 empty empty undefined -18 23 1 12 -262144
-1 -1;
#X text 19 8 If you start with a symbolic atom in a symbol message
\, then run it thru a [list trim] \, you end up with a mystery type
that is just a numeric atom \, but does not work as a float message.
;
#X text 184 93 <-- this generates a symbolic atom with numeric data
\, and outputs a symbol message.;
#X obj 65 112 makefilename %d;
#X floatatom 143 176 5 0 0 0 - - -;
#X symbolatom 191 175 10 0 0 0 - - -;
#X obj 96 196 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 -1
-1;
#X obj 96 152 route bang float symbol list;
#X obj 143 196 bng 15 250 50 0 empty empty float -4 23 1 12 -262144
-1 -1;
#X obj 191 196 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144
-1 -1;
#X obj 239 196 bng 15 250 50 0 empty empty list -2 23 1 12 -262144
-1 -1;
#X obj 287 196 bng 15 250 50 0 empty empty undefined -18 23 1 12 -262144
-1 -1;
#X obj 7 231 atoi;
#X floatatom 9 251 5 0 0 0 - - -;
#X obj 324 349 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 396 349 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 426 350 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 491 349 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 426 330 route 1234;
#X obj 4 154 print RAW;
#X msg 504 261 symbol a;
#X msg 463 195 bang;
#X msg 504 282 1234;
#X msg 262 239 1 2 3 4;
#X msg 502 195 list a b c;
#X text 430 169 "no method for ...";
#X msg 430 195 a;
#X text 573 260 works;
#X text 544 285 works;
#X obj 324 330 select 1234;
#X text 383 218 But "list" works. Careful with inlet distribution;
#X connect 0 0 13 0;
#X connect 2 0 6 0;
#X connect 2 0 1 0;
#X connect 3 0 7 0;
#X connect 4 0 8 0;
#X connect 6 0 5 0;
#X connect 6 1 3 0;
#X connect 6 2 4 0;
#X connect 6 3 9 0;
#X connect 6 4 10 0;
#X connect 6 4 28 0;
#X connect 6 4 39 0;
#X connect 13 0 2 0;
#X connect 13 0 17 0;
#X connect 13 0 22 0;
#X connect 13 0 29 0;
#X connect 14 0 18 0;
#X connect 15 0 19 0;
#X connect 17 0 16 0;
#X connect 17 1 14 0;
#X connect 17 2 15 0;
#X connect 17 3 20 0;
#X connect 17 4 21 0;
#X connect 22 0 23 0;
#X connect 28 0 26 0;
#X connect 28 1 27 0;
#X connect 30 0 39 0;
#X connect 31 0 39 0;
#X connect 32 0 39 0;
#X connect 33 0 39 0;
#X connect 34 0 39 0;
#X connect 36 0 39 0;
#X connect 39 0 24 0;
#X connect 39 1 25 0;


More information about the Pd-dev mailing list