Hi,
(I'm working on the pd~convention workshop regarding data structures, so excpect some more data structure related questions from me the next time... ;)
I'd like to test using symbols as fields in [struct] objects, but I'm getting the impression, that this doesn't work or isn't implemented yet. At least it's not used in the data-structures example patches.
Nevertheless the documentation mentions symbols as a possible scalar type to use in structs.
I can create a [struct somename symbol s] object just fine. Pd even creates a [drawsymbol s] object which I found by guessing its name. However when I try to create such a template using
[append subpatchname s]
[append] does not accept a symbol in its first inlet:
error: append: no method for 'symbol'
It also doesn't want a float in this inlet, which is to be expected though. In fact, it doesn't accept anything anymore.
Am I right to assume, that symbol-fields aren't supported yet? Or am I doing something wrong in attached patch?
Frank Barknecht _ ______footils.org__
Yes, they're there but I've never used them and so they never got properly debugged.
You can also put lists inside structs too (so you can have a list of arrays of lists, etc) but this has also never been debugged and crashes Pd when you try it.
cheers Miller
On Tue, Aug 24, 2004 at 07:41:35PM +0200, Frank Barknecht wrote:
Hi,
(I'm working on the pd~convention workshop regarding data structures, so excpect some more data structure related questions from me the next time... ;)
I'd like to test using symbols as fields in [struct] objects, but I'm getting the impression, that this doesn't work or isn't implemented yet. At least it's not used in the data-structures example patches.
Nevertheless the documentation mentions symbols as a possible scalar type to use in structs.
I can create a [struct somename symbol s] object just fine. Pd even creates a [drawsymbol s] object which I found by guessing its name. However when I try to create such a template using
[append subpatchname s]
[append] does not accept a symbol in its first inlet:
error: append: no method for 'symbol'
It also doesn't want a float in this inlet, which is to be expected though. In fact, it doesn't accept anything anymore.
Am I right to assume, that symbol-fields aren't supported yet? Or am I doing something wrong in attached patch?
Ciao
Frank Barknecht _ ______footils.org__
#N struct typ float x float y symbol s; #N canvas 0 0 601 279 10; #N canvas 282 404 450 300 typ 0; #X obj 126 101 struct typ float x float y symbol s; #X obj 125 169 drawsymbol s; #X restore 103 138 pd typ; #N canvas 519 218 450 300 paint 0; #X scalar typ 0 0 symbol ;; #X scalar typ 0 0 symbol ;; #X scalar typ 0 0 symbol ;; #X scalar typ 0 0 symbol ;; #X scalar typ 0 0 symbol ;; #X restore 102 164 pd paint; #X obj 290 157 append typ s; #X obj 369 113 pointer; #X msg 369 88 traverse pd-paint , bang; #X symbolatom 211 63 10 0 0 0 - - -; #X floatatom 341 62 5 0 0 0 - - -; #X msg 297 58 bang; #X msg 162 64 s; #X text 195 23 nothing works :(; #X connect 3 0 2 1; #X connect 4 0 3 0; #X connect 5 0 2 0; #X connect 6 0 2 0; #X connect 7 0 2 0; #X connect 8 0 2 0;
Hallo, Miller Puckette hat gesagt: // Miller Puckette wrote:
Yes, they're there but I've never used them and so they never got properly debugged.
I have the expression, that data structures are a bit underused by the Pd community in general. Somehow they seem to be less "sexy" compared to Gem or PDP. I guess the only one I know who uses (or has used) them a lot is Orm Finnendahl...
Maybe my upcoming "Structures for Dummies" tutorial can generate more feedback. At least I hope it does. But I'll keep it secret until after the pd~conv.
You can also put lists inside structs too (so you can have a list of arrays of lists, etc) but this has also never been debugged and crashes Pd when you try it.
I did not yet arrive at lists...
Anyway I have found some other fun ways to crash Pd by using structs. Maybe my favourite one so far is to forget to give a struct a name. Creating a [struct float x float y] will happily let Pd reach Nirvana in no time.
Frank Barknecht _ ______footils.org__