[PD] list wonkiness

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





hi,.
 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
strange
(to me at least) behaviour.

the following function gives the same value for argc whether the input is
a
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
to
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"
and
 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?

nk





More information about the Pd-list mailing list