Branch: Tag:

1998-03-01

1998-03-01 03:45:46 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

should now handle multisets and mappings too...

Rev: lib/modules/Array.pmod:1.18

15:    if(mappingp(arr))    return mkmapping(indices(arr),map(values(arr),fun,@args));    +  if(multisetp(arr)) +  return mkmultiset(map(indices(arr,fun,@args))); +     switch(sprintf("%t",fun))    {    case "int":
50:    for(e=0;e<sizeof(ret);e++) if(ret[e]) r[i[e]]=v[e];       return r; -  }else{ +  } +  if(multisetp(arr)) +  { +  return mkmultiset(filter(indices(arr,fun,@args))); +  } +  else +  {    int d;    ret=map(arr,fun,@args);    for(e=0;e<sizeof(arr);e++) if(ret[e]) ret[d++]=arr[e];