[PD-dev] Passing creation arguments to newmethod

Matt Barber brbrofsvl at gmail.com
Thu Aug 5 20:22:31 CEST 2021

Hi dev list,

Question about the syntax of creation arguments and type checking. I was
working on an object yesterday, with the following setup line:

grab_class = class_new(s, (t_newmethod)grab_new, (t_method)grab_free,
        sizeof(t_grab), 0, A_DEFFLOAT, A_DEFSYM, 0);

I'd assumed that it would require grab_new() to have this declaration to
match the order float, symbol as in class_new:

static void *grab_new(t_floatarg f, t_symbol *s);

but it only worked with the reverse:

static void *grab_new(t_symbol *s, t_floatarg f);

We ended up using A_GIMME, but for the future, is there a way to know the
order of parameters passed to the creator?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20210805/22cf6d20/attachment-0001.htm>

More information about the Pd-dev mailing list