Menu

#237 empty lists != bang ([list-split] outputs bad bang type)

v0.41
pending-fixed
puredata (322)
5
2011-07-15
2008-02-11
No

Hi,
Attached it a patch demonstrating the bug. [list-split] outputs a bang on the right outlet when the input is a bang, but it seems to invisibly add the "list" selector so that the bang is unrecognized by, for example, [until] (giving the error: inlet: expected 'bang' but got 'list')

Cheers
Luke

Discussion

  • Frank Barknecht

    Frank Barknecht - 2008-02-11

    Demonstration of list-split issue (same, but no whitespace in name)

     
  • Frank Barknecht

    Frank Barknecht - 2008-02-11

    Logged In: YES
    user_id=569446
    Originator: NO

    I guess you mean [list split] (without dash). If it's a bug it's one in [until] I believe. [list split] outputs a zero-element list in your example, which is what the help-file says it would do. Usually empty lists get converted to a bang. I suppose this happens at an object's inlet. However [until] doesn't convert - probably it needs to get a until_list2(...) method?

    (Btw: Better avoid whitespace in the names of example patches uploaded here. I uploaded a new version and deleted the old.)
    File Added: list-split-bug.pd

     
  • Claude Heiland-Allen

    Logged In: YES
    user_id=769033
    Originator: NO

    I'd say it was a bug in Pd core. Rather than adding special cases to *all* objects, I think the "distribute lists over inlets if there is no method for 'list'" code should notice empty lists and call the 'bang' method, furthermore extra 'list' methods for objects that don't really need them should be removed. Both these steps are necessary to maintain the ("list",{}) == ("bang",{}) invariant in more places with less code.

    Something like this (totally untested, so be warned):

    --- m_obj.c.orig 2008-02-11 08:48:44.000000000 +0000
    +++ m_obj.c 2007-12-17 20:28:49.000000000 +0000
    @@ -224,7 +224,7 @@
    t_atom *ap;
    int count;
    t_inlet *ip = ((t_object *)x)->ob_inlet;
    - if (!argc) return;
    + if (!argc) { pd_bang(&x->ob_pd); return; }
    for (count = argc-1, ap = argv+1; ip && count--; ap++, ip = ip->i_next)
    {
    if (ap->a_type == A_POINTER) pd_pointer(&ip->i_pd, ap->a_w.w_gpointer);

     
  • IOhannes m zmölnig

    • assigned_to: nobody --> millerpuckette
    • summary: [list-split] outputs bad bang type --> empty lists != bang ([list-split] outputs bad bang type)
     
  • IOhannes m zmölnig

    • status: open --> open-fixed
     
  • IOhannes m zmölnig

    • status: open-fixed --> pending-fixed
     
  • IOhannes m zmölnig

    since #1936157 got accepted, i guess this can be closed as well

     

Anonymous
Anonymous

Add attachments
Cancel