Re: [PD] Multi dimensional [list]

2007-01-02 Thread Mathieu Bouchard

On Mon, 1 Jan 2007, Patco wrote:

I've done something like that for storing parameters in arrays, but like 
matthieux bouchard said for matrixes, the length of the 'listed list' is 
fixed.


the main thing missing in my nested list plan is a name for the atomt 
type. it can't really be A_LIST because of this correspondence


  atomtype - selector
  A_FLOAT float
  A_SYMBOLsymbol
  A_POINTER   pointer

but A_LIST can't work because the name list is already taken for a type 
of non-atom message. (an atom message is one carries exactly one atom 
which is always supposed to be of the type indicated by the selector)


I'm thinking of plist meaning pointer-to-list, or listp as list 
pointer, because that'll be what it is. if you put this in a 
messagebox:


  {1 2 3}

it would be equivalent to writing it with that selector, e.g.:

  listp {1 2 3}

and because that's an atomtype and that it would be able to contain the 
same thing that a regular list-message can, you will be able to nest 
listp into list or into listp:


  1 2 3 {4 5 6}
is like
  list 1 2 3 {4 5 6}

  {1 2 3 {4 5 6}}
is like
  listp 1 2 3 {4 5 6}

so, what do you think? is listp a good word? what else could it be?

(besides, another advantage of listp over regular lists is that they would 
be more efficient because they would require less copying of memory)


 _ _ __ ___ _  _ _ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Multi dimensional [list]

2007-01-02 Thread Patco

Mathieu Bouchard a écrit :


I'm thinking of plist meaning pointer-to-list, or listp as list 
pointer, because that'll be what it is. if you put this in a messagebox:


  {1 2 3}

it would be equivalent to writing it with that selector, e.g.:

  listp {1 2 3}

and because that's an atomtype and that it would be able to contain 
the same thing that a regular list-message can, you will be able to 
nest listp into list or into listp:


  1 2 3 {4 5 6}
is like
  list 1 2 3 {4 5 6}

  {1 2 3 {4 5 6}}
is like
  listp 1 2 3 {4 5 6}

For quantitative structure-property relationship models, that could be a 
very good tool.
so, what do you think? is listp a good word? 
I don't know if I could help to find the good answer because I'm rather 
seducted by the word


E_STATE

for some reasons I would explain if it's really important,

which means electrotopological state.

Patco.






___ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com



___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Multi dimensional [list]

2006-12-31 Thread Patco



 A two-dimensional array data-type
out of a list of floats with delimiter items to go with something
like 2dtabread and 2dtabwrite abstractions. - Has anyone done that
already?

I've done something like that for storing parameters in arrays,
but like matthieux bouchard said for matrixes, the length of the 'listed 
list' is fixed.

An example with arrays is attached.
I would be glad to make a version where the list lengthes are not fixed,
but it's very complicated to do with arrays, [trigger], [once] and 
[until] maybe someone will find it out later...

PC.



#N canvas 28 9 707 671 12;
#X obj 161 273 + 1;
#X obj 201 274 + 2;
#X obj 168 246 i;
#X obj 208 247 i;
#X obj 128 249 i;
#X obj 254 218 sel 0 1;
#X obj 246 168 * 3;
#X obj 50 208 t f b;
#X obj 143 203 t f b;
#X obj 97 203 t f b;
#X obj 280 444 i;
#X obj 435 274 * 3;
#X obj 314 444 + 1;
#X msg 279 388 3;
#X obj 280 414 until;
#X obj 254 307 t b a b;
#X obj 279 468 t a a;
#X obj 314 518 mod 3;
#X obj 279 546 demux 0 1 2;
#X msg 345 613 set \$1;
#X msg 405 611 set \$1;
#X msg 279 617 set \$1;
#X obj 321 334 i;
#X obj 279 333 list;
#X obj 345 303 t a b;
#X obj 279 360 t b a;
#X obj 314 389 list trim;
#X floatatom 148 134 5 0 0 0 - - -;
#X floatatom 98 136 5 0 0 0 - - -;
#X floatatom 43 139 5 0 0 0 - - -;
#X floatatom 497 51 5 0 96 0 list_pos - -;
#X text 380 13 List Of Fixed List;
#X obj 299 54 tgl 15 0 empty empty List_Select 17 7 0 10 -262144 -1
-1 1 1;
#N canvas 0 0 450 300 (subpatch) 0;
#X array LOFL2 100 float 0;
#X coords 0 -1 99 1 100 70 1;
#X restore 573 176 graph;
#N canvas 0 0 450 300 (subpatch) 0;
#X array LOFL1 100 float 0;
#X coords 0 -1 99 1 100 70 1;
#X restore 578 303 graph;
#X obj 145 177 / 100;
#X obj 42 169 / 100;
#X obj 93 173 / 100;
#X msg 254 244 set LOFL1;
#X msg 272 272 set LOFL2;
#X obj 279 494 tabread LOFL1;
#X obj 25 432 tabwrite LOFL1;
#X obj 436 250 r list-pos;
#X obj 21 68 r A;
#X obj 101 68 r B;
#X obj 166 68 r C;
#X obj 279 639 s A;
#X obj 344 635 s B;
#X obj 406 641 s C;
#X obj 254 192 r list-sel;
#X obj 246 146 r list-pos;
#X obj 299 76 s list-sel;
#X obj 496 75 s list-pos;
#X text 36 36 three values list;
#X obj 554 48 hradio 15 1 0 8 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X obj 279 579 * 100;
#X obj 345 580 * 100;
#X obj 405 577 * 100;
#X connect 0 0 41 1;
#X connect 1 0 41 1;
#X connect 2 0 0 0;
#X connect 3 0 1 0;
#X connect 4 0 41 1;
#X connect 5 0 38 0;
#X connect 5 1 39 0;
#X connect 6 0 4 1;
#X connect 6 0 2 1;
#X connect 6 0 3 1;
#X connect 7 0 41 0;
#X connect 7 1 4 0;
#X connect 8 0 41 0;
#X connect 8 1 3 0;
#X connect 9 0 41 1;
#X connect 9 1 2 0;
#X connect 10 0 12 0;
#X connect 10 0 16 0;
#X connect 11 0 24 0;
#X connect 12 0 10 1;
#X connect 13 0 14 0;
#X connect 14 0 10 0;
#X connect 15 1 23 0;
#X connect 15 2 22 0;
#X connect 16 0 40 0;
#X connect 16 1 17 0;
#X connect 17 0 18 1;
#X connect 18 0 55 0;
#X connect 18 1 56 0;
#X connect 18 2 57 0;
#X connect 19 0 47 0;
#X connect 20 0 48 0;
#X connect 21 0 46 0;
#X connect 22 0 10 1;
#X connect 23 0 25 0;
#X connect 24 0 22 0;
#X connect 24 1 23 0;
#X connect 25 0 13 0;
#X connect 25 1 26 0;
#X connect 26 0 40 0;
#X connect 27 0 35 0;
#X connect 28 0 37 0;
#X connect 29 0 36 0;
#X connect 30 0 52 0;
#X connect 32 0 51 0;
#X connect 35 0 8 0;
#X connect 36 0 7 0;
#X connect 37 0 9 0;
#X connect 38 0 15 0;
#X connect 38 0 41 0;
#X connect 39 0 15 0;
#X connect 39 0 41 0;
#X connect 40 0 18 0;
#X connect 42 0 11 0;
#X connect 43 0 29 0;
#X connect 44 0 28 0;
#X connect 45 0 27 0;
#X connect 49 0 5 0;
#X connect 50 0 6 0;
#X connect 54 0 52 0;
#X connect 55 0 21 0;
#X connect 56 0 19 0;
#X connect 57 0 20 0;
___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Multi dimensional [list]

2006-12-31 Thread Patco

Patco a écrit :


but like matthieux bouchard said for matrixes, the length of the 
'listed list' is fixed.



oops, it's Mathieu, not matthieux...:-D
PC.





___ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com



___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Multi dimensional [list]

2006-12-30 Thread Steffen


On 25/12/2006, at 16.02, Frank Barknecht wrote:

If you want a list of lists data structure in Pd, you can do it  
with Pd's data structures however.


list of lists is the same as two-dimensional arrays except the  
lists (in the list) can consist of something non-float too.


That sounds nice since it will provide and easier solution to what  
I'm having a hard time building: A two-dimensional array data-type  
out of a list of floats with delimiter items to go with something  
like 2dtabread and 2dtabwrite abstractions. - Has anyone done that  
already?



___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Multi dimensional [list]

2006-12-30 Thread Frank Barknecht
Hallo,
Steffen hat gesagt: // Steffen wrote:

 On 25/12/2006, at 16.02, Frank Barknecht wrote:
 
 If you want a list of lists data structure in Pd, you can do it  
 with Pd's data structures however.
 
 list of lists is the same as two-dimensional arrays except the  
 lists (in the list) can consist of something non-float too.
 
 That sounds nice since it will provide and easier solution to what  
 I'm having a hard time building: A two-dimensional array data-type  
 out of a list of floats with delimiter items to go with something  
 like 2dtabread and 2dtabwrite abstractions. - Has anyone done that  
 already?

I guess you will like the iemmatrix-externals. 

Ciao
-- 
 Frank Barknecht _ __footils.org_ __goto10.org__

___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Multi dimensional [list]

2006-12-30 Thread Frank Barknecht
Hallo,
Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote:

 On Sat, 30 Dec 2006, Frank Barknecht wrote:
 Steffen hat gesagt: // Steffen wrote:
 That sounds nice since it will provide and easier solution to what
 I'm having a hard time building: A two-dimensional array data-type
 out of a list of floats with delimiter items to go with something
 like 2dtabread and 2dtabwrite abstractions. - Has anyone done that
 already?
 I guess you will like the iemmatrix-externals.
 
 The difference between matrices and lists-of-lists is that, in the former 
 case, the sublists need to be of fixed size.

Well, yes, that's of course true, and if it's an issue for a certain
application, then a more elaborate approach is needed. For example
something like [pool] can be handy here. 

Just for illustrating how data structures could be used to build
slightly more complex, uhm, data structures, I made a lists-of-lists
in attached useless example patch.

Ciao
-- 
 Frank Barknecht _ __footils.org_ __goto10.org__
#N canvas 425 34 699 423 10;
#N canvas 60 142 450 300 LOL 0;
#X obj 34 55 struct LOL float x array lol L;
#X restore 124 113 pd LOL;
#N canvas 147 477 450 300 LEL 0;
#X obj 100 65 struct LEL float y;
#X restore 124 59 pd LEL;
#N canvas 494 518 450 300 L 0;
#X obj 101 57 struct L array l LEL;
#X restore 124 86 pd L;
#X text 184 59 list element (a float);
#X text 184 89 list (list of LELs);
#X text 185 113 list of lists (list of Ls);
#N canvas 0 0 450 300 container 0;
#X restore 122 165 pd container;
#N canvas 0 0 749 530 create-LOL 0;
#X obj 284 246 append LOL x;
#X obj 284 277 pointer;
#X obj 364 225 pointer;
#X msg 364 199 traverse pd-container \, bang;
#X msg 284 224 0;
#X msg 265 70 bang;
#X obj 184 317 setsize LOL lol;
#X obj 265 100 t b b b b;
#X obj 132 361 element LOL lol;
#X obj 60 401 setsize L l;
#N canvas 0 0 450 300 count 0;
#X obj 81 47 inlet;
#X obj 80 107 until;
#X obj 83 75 t a b;
#X obj 128 108 0;
#X obj 78 133 f 0;
#X obj 106 132 + 1;
#X obj 79 167 outlet;
#X connect 0 0 2 0;
#X connect 1 0 4 0;
#X connect 2 0 1 0;
#X connect 2 1 3 0;
#X connect 3 0 4 1;
#X connect 4 0 5 0;
#X connect 4 0 6 0;
#X connect 5 0 4 1;
#X restore 60 310 pd count;
#X obj 60 284 t a a;
#X obj 60 334 t b a;
#X obj 60 260 f 4;
#X obj 60 368 f 4;
#X msg 583 200 clear;
#X obj 583 224 s pd-container;
#X text 543 154 clear container subpatch;
#X text 360 269 create LOL in container;
#X text 300 319 set how many elements lol in LOL should contain.
;
#X text 262 363 For each lol in LOL ...;
#X text 254 398 ... set size of contained list.;
#X obj 307 70 inlet;
#X obj 223 282 outlet;
#X text 140 260 also send pointer!;
#X connect 0 0 1 0;
#X connect 0 0 23 0;
#X connect 1 0 6 1;
#X connect 1 0 8 1;
#X connect 2 0 0 1;
#X connect 3 0 2 0;
#X connect 4 0 0 0;
#X connect 5 0 7 0;
#X connect 7 0 13 0;
#X connect 7 1 4 0;
#X connect 7 2 3 0;
#X connect 7 3 15 0;
#X connect 8 0 9 1;
#X connect 10 0 12 0;
#X connect 11 0 10 0;
#X connect 11 1 6 0;
#X connect 12 0 14 0;
#X connect 12 1 8 0;
#X connect 13 0 11 0;
#X connect 14 0 9 0;
#X connect 15 0 16 0;
#X connect 22 0 7 0;
#X restore 120 264 pd create-LOL;
#X text 228 159 container for LOL-scalars (will seem empty even if
full \, because no drawing instructions were used);
#X text 242 262 create new List Of Lists;
#N canvas 0 0 793 748 get-set-LOLs 0;
#X obj 249 300 element LOL lol;
#X obj 177 332 element L l;
#X floatatom 207 406 5 0 0 0 - - -;
#X floatatom 177 153 5 0 3 0 - - -;
#X floatatom 239 152 5 0 3 0 - - -;
#X obj 207 186 t b a;
#X floatatom 119 376 5 0 0 0 - - -;
#X obj 177 356 t a a;
#X msg 131 168 bang;
#X obj 207 379 get LEL y;
#X obj 119 406 set LEL y;
#X obj 177 87 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1
-1 1;
#X obj 239 87 vradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X obj 334 118 inlet;
#X obj 177 224 pack 0 0 p;
#X text 333 99 pointer to LOL comes in here!;
#X obj 177 254 unpack 0 0 p;
#X msg 365 179 traverse pd-container \, next;
#X obj 365 204 pointer;
#X text 366 159 alternatively select pointer manually.;
#X text 175 54 select LEL element with (x \, y);
#X connect 0 0 1 1;
#X connect 1 0 7 0;
#X connect 3 0 14 0;
#X connect 4 0 5 0;
#X connect 5 0 14 0;
#X connect 5 1 14 1;
#X connect 6 0 10 0;
#X connect 7 0 10 1;
#X connect 7 1 9 0;
#X connect 8 0 14 0;
#X connect 9 0 2 0;
#X connect 11 0 3 0;
#X connect 12 0 4 0;
#X connect 13 0 14 2;
#X connect 14 0 16 0;
#X connect 16 0 1 0;
#X connect 16 1 0 0;
#X connect 16 2 0 1;
#X connect 17 0 18 0;
#X connect 18 0 14 2;
#X restore 120 311 pd get-set-LOLs;
#X text 242 310 set or get internal list elements;
#X msg 120 241 click me!;
#X text 123 36 Data structures:;
#X connect 7 0 10 0;
#X connect 12 0 7 0;
___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Multi dimensional [list]

2006-12-25 Thread Frank Barknecht
Hallo,
Jiri Heitlager hat gesagt: // Jiri Heitlager wrote:

 Is it possible to create a [list] where each item is a [list]?

Not without tricks. See the list fifo thread from last week or so
for one such trick. If you want a list of lists data structure in
Pd, you can do it with Pd's data structures however.

Ciao
-- 
 Frank Barknecht _ __footils.org_ __goto10.org__

___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list