--- On Fri, 7/8/11, Ivica Ico Bukvic <[email protected]> wrote:
> From: Ivica Ico Bukvic <[email protected]> > Subject: RE: [PD] route - pack issue > To: "Jonathan Wilkes" <[email protected]> > Cc: [email protected] > Date: Friday, July 8, 2011, 8:12 PM > > > Jonathan Wilkes <[email protected]> > wrote: > > > > > > >--- On Fri, 7/8/11, Ivica Ico Bukvic <[email protected]> wrote: > > > >> From: Ivica Ico Bukvic <[email protected]> > >> Subject: RE: [PD] route - pack issue > >> To: "'Jonathan Wilkes'" <[email protected]> > >> Cc: [email protected] > >> Date: Friday, July 8, 2011, 4:54 PM > >> > static void pack_list(t_pack *x, > >> t_symbol *s, int ac, t_atom *av) > >> > { > >> > if (ac==0) > >> > pack_bang(x); > >> > else > >> > > >> obj_list(&x->x_obj, 0, ac, av); > >> > } > >> > >> > >> Many thanks for this contribution! I will add this > to > >> pd-l2ork. However, shouldn't also route output > bang when > >> having an empty list? > > > >[route] already does this. > > But I thought OP suggested [route start] -> [pack] did > not work since pack received empty list instead of bang and > did not know what to do with it. Well, [route] isn't the only one that can output an empty list-- the [list] family objects, [trigger], and probably others do, too. Anyway, I think there are only some special cases where this gets tricky: when an object class defines both a bang method and a list method like [pack] does, or with an object like [route] which just has a list method as a catchall in which "bang", "float", and "symbol" messages are parsed manually. Otherwise, Pd does some automagic message conversion (defined in m_class.c) so that, for example, if [foo] only has a "bang" method and no list method, it will just call the "bang" method when an empty list is received at its inlet. So one needn't worry whether or not an object outputs an empty list, just if the special case objects like [pack] and [route] handle them correctly. -Jonathan > > > > >> > >> Best wishes, > >> > >> Ico > >> > >> > > > Ivica Ico Bukvic, D.M.A > Composition, Music Technology > Director, DISIS Interactive Sound & Intermedia Studio > Director, L2Ork LinuxLaptop Orchestra > Assistant Co-Director, CCTAD > CHCI, CS, and Art (by courtesy) > Virginia Tech > Department of Music > Blacksburg, VA 24061-0240 > (540) 231-6139 > (540) 231-5034 (fax) > disis.music.vt.edu > l2ork.music.vt.edu > ico.bukvic.net > _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
