[PD] A_CANT (was: thread about args in an external, just look up and you'll probably see it there)

IOhannes m zmoelnig zmoelnig at iem.at
Tue May 27 13:13:19 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 2014-05-27 00:49, Jonathan Wilkes wrote:
> 
> because the final "0" is the way to tell Pd "no more args,
> please". Since we didn't specify any in the first place, it is
> equivalent to writing "A_NULL" followed by the "0".

hmm.

this is valid C-code:
> class_addmethod(x_class, (t_method)x_foo, gensym("foo"), 0);

but it is not valid C++-code, since the first argument after the
symbol must be of type (t_atomtype).

in C++ you would have to write either
> class_addmethod(y_class, (t_method)y_foo, gensym("foo"), A_NULL);
or
> class_addmethod(x_class, (t_method)x_foo, gensym("foo"),
static_cast<t_atomtype>(0));

t_atomtype is an enumeration, so it's valid to use an int instead in
C, but not in C++.

so i guess your explanation should read:
> "A_NULL" is the way to tell Pd "no more args, please".

ghmsdr
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBCAAGBQJThHNPAAoJELZQGcR/ejb4lMQP/iosIdr8T7SfVn22MlIKIOCv
WF3uhRfpvfudPzUBysasR2RoD/hXDK25OY3fMZ9XY+oYXbcBwiTkMqB9Aw7889ZB
Pp5CJPVvwfNgamkhBxDy8hBv6OjUhvWt4u9EEeSWR0bt1+VBpKzDY+bwkY/T0WcA
VBZUKpLMh8VIuSV+Z4BjXquEdYRmqCxVmbQzJ3R/2uN+voVxbdEA5sKi6GkZY6uN
tuTPU1q7EnU4VZ0eLCl69ETGmEagz6L6+muHKMiOGDKhFJphVN2/IKDxPwdu6kPO
MV6CSNMCnAFsYfTNHE+lI+OMn9a+Thof45CbEsEyeHzmxXtU2ipHeBHQ33oHrypr
lIER3YrAKsM1naDzUx/gdEX+8S7y0Ijhx9aWUFuEQDdvxEpon7AO1hUuMdrxMY3a
ZK5X5xmUP47lcAw4hV0X96zcrmt/C0g8s8q3U7FzbvFH7BJ21lZ48PbDTbO08CLz
VKmhv/2w5AnCiwX/lYOvjJjpznQ9I7lH7nzDWWykoT13Yoi8cab2S354wsf+kpLf
kaULpcjljxWT7+WD+RvoXJ/v6iAqq8kwMk2o1QiX+0N4Cnl2lEx17gNJi2Cq4/Mz
v4BYBjmmpvUDlhslRiteb2Dl4bQdp4apKwIXjAQUMxS19wMsb1mNs8B9R+NQym0/
/VsOKpSIDpj4V+tYhUCa
=waUr
-----END PGP SIGNATURE-----



More information about the Pd-list mailing list