Forums > Dev

more specific arguments in functions


f.e
October 17, 2006 | 9:11 am

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|


October 17, 2006 | 9:14 am

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



f.e
October 17, 2006 | 9:17 am

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
>
>
>


October 17, 2006 | 9:23 am

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



f.e
October 17, 2006 | 9:24 am

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
>



f.e
October 17, 2006 | 9:27 am

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
>


October 17, 2006 | 9:32 am

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.


October 17, 2006 | 9:33 am

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


October 17, 2006 | 9:34 am

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.
>
>



f.e
October 17, 2006 | 9:42 am

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.
>
>


Viewing 10 posts - 1 through 10 (of 10 total)