Hi Samir,
Were the different values boxed before you assigned them? Because the string
and the integer are of different types they need to be boxed using ; so that
they can be held apart before they are assigned.
'a b c'=: (i. 2 3) ; 1 ; 'a string' NB. parenthesis in the array are
necessary because of right to left execution of verbs.
a
0 1 2
3 4 5
b
1
c
a string
Hope this is helpful.
Cheers, bob
> On Mar 7, 2021, at 08:56, smir via Programming <[email protected]>
> wrote:
>
> Dears, apologies for the lame question but how can we pass different types of
> variables to function/verb? For example if a function will receive variables
> a, b, and c of types array, integer, and string respectively
>
> get =: {{ (I.(<c) E. b {|:a){a
>
> the target of verb is to filter column of index 'c' in array 'a' to a
> specific string 'b'
>
> I tried taking y as multi-variables 'a b c' =: y , but it didn't work for
> different types of variables.
>
> Regards,
> Samir
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm