more specific arguments in functions

Oct 17, 2006 at 9:11am

more specific arguments in functions

Is it possible (i guess yes) to specify a function to wait for (int,
int, A_GIMME) arguments ?

f.e


f.e chanfrault | aka | personal computer music
> >>>>>> http://www.personal-computer-music.com
> >>>>>> |sublime music for a desperate people|

#28206
Oct 17, 2006 at 9:14am

Am 17.10.2006 um 11:11 schrieb f.e:

> Is it possible (i guess yes) to specify a function to wait for
> (int, int, A_GIMME) arguments ?

It’s all in A_GIMME, just verify the first two arguments to be int!
greetings, Thomas


Thomas Grill

http://grrrr.org

#86335
Oct 17, 2006 at 9:17am

I knew but i wanted to shortcut the typechecking in the function itself ;-)

BTW, my compiler deosn’t like :

if ((ac>=3) && (av[0]->a_type = A_LONG) && (av[1]->a_type = A_LONG))

f.e

f.e chanfrault | aka | personal computer music
> >>>>>> http://www.personal-computer-music.com
> >>>>>> |sublime music for a desperate people|

Thomas Grill wrote:
>
> Am 17.10.2006 um 11:11 schrieb f.e:
>
>> Is it possible (i guess yes) to specify a function to wait for (int,
>> int, A_GIMME) arguments ?
>
> It’s all in A_GIMME, just verify the first two arguments to be int!
> greetings, Thomas
>
> —
> Thomas Grill
> http://grrrr.org
>
>
>

#86336
Oct 17, 2006 at 9:23am

f.e wrote:

> I knew but i wanted to shortcut the typechecking in the function itself ;-)
>
> BTW, my compiler deosn’t like :
>
> if ((ac>=3) && (av[0]->a_type = A_LONG) && (av[1]->a_type = A_LONG))

you mean == and not =, I guess….

Olaf

#86337
Oct 17, 2006 at 9:24am

Oh, same as Java indeed. But still not working… grrrrr

f.e

f.e chanfrault | aka | personal computer music
> >>>>>> http://www.personal-computer-music.com
> >>>>>> |sublime music for a desperate people|

Olaf Matthes wrote:
> f.e wrote:
>
>> I knew but i wanted to shortcut the typechecking in the function
>> itself ;-)
>>
>> BTW, my compiler deosn’t like :
>>
>> if ((ac>=3) && (av[0]->a_type = A_LONG) && (av[1]->a_type = A_LONG))
>
> you mean == and not =, I guess….
>
> Olaf
>

#86338
Oct 17, 2006 at 9:27am

Strange. In an old IRCAM source, i’ve found typechecking examples using
switch(av->a_type), then in the Fujinaga, switch(av.a_type)… The last
one works.

f.e

f.e chanfrault | aka | personal computer music
> >>>>>> http://www.personal-computer-music.com
> >>>>>> |sublime music for a desperate people|

Olaf Matthes wrote:
> f.e wrote:
>
>> I knew but i wanted to shortcut the typechecking in the function
>> itself ;-)
>>
>> BTW, my compiler deosn’t like :
>>
>> if ((ac>=3) && (av[0]->a_type = A_LONG) && (av[1]->a_type = A_LONG))
>
> you mean == and not =, I guess….
>
> Olaf
>

#86339
Oct 17, 2006 at 9:32am

It depends on whether you are working with a t_atom or a t_atom* —
t_atom is a struct, whose members can be accessed with the .
operator. t_atom* is a pointer to a struct, whose members can be
accesses with the -> operator.

jb

Am 17.10.2006 um 11:27 schrieb f.e:

> Strange. In an old IRCAM source, i’ve found typechecking examples
> using switch(av->a_type), then in the Fujinaga, switch
> (av.a_type)… The last one works.

#86340
Oct 17, 2006 at 9:33am

On 10/17/06, f.e

wrote:
> Strange. In an old IRCAM source, i’ve found typechecking examples using
> switch(av->a_type), then in the Fujinaga, switch(av.a_type)… The last
> one works.

The difference here depends on what av is.

i.e.:
t_atom av[1];
av->a_type

or

t_atom av;
av.a_type

wes

#86341
Oct 17, 2006 at 9:34am

Jinx!

On 10/17/06, Jeremy Bernstein wrote:
> It depends on whether you are working with a t_atom or a t_atom* –
> t_atom is a struct, whose members can be accessed with the .
> operator. t_atom* is a pointer to a struct, whose members can be
> accesses with the -> operator.
>
> jb
>
> Am 17.10.2006 um 11:27 schrieb f.e:
>
> > Strange. In an old IRCAM source, i’ve found typechecking examples
> > using switch(av->a_type), then in the Fujinaga, switch
> > (av.a_type)… The last one works.
>
>

#86342
Oct 17, 2006 at 9:42am

I thought about something with this flavor… Thanks a lot, it’s clearer
now.

best regards

f.e

f.e chanfrault | aka | personal computer music
> >>>>>> http://www.personal-computer-music.com
> >>>>>> |sublime music for a desperate people|

Jeremy Bernstein wrote:
> It depends on whether you are working with a t_atom or a t_atom* —
> t_atom is a struct, whose members can be accessed with the . operator.
> t_atom* is a pointer to a struct, whose members can be accesses with
> the -> operator.
>
> jb
>
> Am 17.10.2006 um 11:27 schrieb f.e:
>
>> Strange. In an old IRCAM source, i’ve found typechecking examples
>> using switch(av->a_type), then in the Fujinaga, switch(av.a_type)…
>> The last one works.
>
>

#86343

You must be logged in to reply to this topic.