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

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


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

> If this is a totally useless and illegal value, then nothing should  
> ever generate it.  By definition, anything that can be interrupted as  
> a number, should be a float.  The Pd manual 2.1.2 says "Anything that  
> is not a valid number is considered a symbol" ("symbol" here meaning  
> symbolic atom, not symbol message).  That means that the converse  
> should be true too: "anything that is a valid number should be  
> considered a float".

The problem is: [makefilename %d] generates a *symbol* whose content
data is a numeric value. This means, the "1234" in your student's
example patch actually is *not* a float, but a symbol atom! So
converting this back to a known type after trimming will generate a
symbol, not a float. See attached patch which has a small change to
do a double conversion: one to the Land of Oz and then back into Pd
land.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 478 110 616 391 10;
#X msg 65 89 1234;
#X obj 19 285 print;
#X obj 65 235 list trim;
#X floatatom 112 309 5 0 0 0 - - -;
#X symbolatom 160 308 10 0 0 0 - - -;
#X obj 65 329 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 -1
-1;
#X obj 65 285 route bang float symbol list;
#X obj 112 329 bng 15 250 50 0 empty empty float -4 23 1 12 -262144
-1 -1;
#X obj 160 329 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144
-1 -1;
#X obj 208 329 bng 15 250 50 0 empty empty list -2 23 1 12 -262144
-1 -1;
#X obj 256 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 msg 106 89 1.23;
#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 65 260 list;
#X text 108 262 convert back to what?;
#X text 147 237 generate mystery type;
#X connect 0 0 14 0;
#X connect 2 0 1 0;
#X connect 2 0 23 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 13 0 14 0;
#X connect 14 0 2 0;
#X connect 14 0 18 0;
#X connect 15 0 19 0;
#X connect 16 0 20 0;
#X connect 18 0 17 0;
#X connect 18 1 15 0;
#X connect 18 2 16 0;
#X connect 18 3 21 0;
#X connect 18 4 22 0;
#X connect 23 0 6 0;


More information about the Pd-dev mailing list