[PD] list wonkiness

Nik nik at xdv.org
Wed Aug 22 18:48:57 CEST 2001

 ive been modifying a version of  ggee unwonk object (to tokenize a space
seperated string + output the result as a list) and have noticed some
(to me at least) behaviour.

the following function gives the same value for argc whether the input is
list, or if it is a single string with elements seperated by spaces.

im not really clear how pd handles lists, but i assumed argv is a pointer
a 'list' of atoms, which has argc number of elements?

static void slonk_slonk(t_slonk *x, t_symbol *s, int argc, t_atom *argv)
  t_atom *ap;
  t_slonkout *u;
  int i;
  int margc = argc;

  post("slonk: how long? %d", argc);

    if (argc > x->x_n - 1) margc = x->x_n - 1;

    if (argc - margc > 0) {
         ap = argv;
         u = x->x_vec + margc;
         outlet_list(u->u_outlet,0,argc, ap);

so, if i send this object two messages
 slonk "0.4 0.34 1 0.11 8.33"
 slonk 0.4 0.34 1 0.11 8.33

and the output is like this ->
slonk: how long? 5
-slkn: list "0.4 0.34 1 0.11 8.33"
slonk: how long? 5
-slkn: 0.4 0.34 1 0.11 8.33

maybe this isnt really the best way to do it,  so  the next question is
  is there a better way to acomplish this?


More information about the Pd-list mailing list