this took me a while to find out, so maybe you dont
know,
if you use an explicit function, you get a freebie
multi assignement method

f=: 3 : 0
'N A B' =: y
N+A*B
)
f list

--- Sean McGowan <[EMAIL PROTECTED]> wrote:

> Hi there,
> 
>  
> 
> I'm new to J and have a question regarding tacit
> functions. I need to write
> tacit a J function
> 
> that takes a list of 3 numbers as its argument. How
> do you pass and
> reference the elements
> 
> of a list in a function?
> 
>  
> 
> The following seems to work when passing one number:
> 
>  
> 
>    tax =: 0.10 & *
> 
>    tax 10
> 
> 1
> 
>  
> 
> I wish to pass 3 numbers in a list and be able to
> use each number in the
> computation.
> 
> I know list elements can be accessed like this:
> 
>  
> 
>    list =: 10 0 1
> 
>    N =: 0 { list
> 
>    A =: 1 { list
> 
>    B =: 2 { list
> 
>  
> 
>    N
> 
> 10
> 
>    A
> 
> 0
> 
>    B
> 
> 1
> 
>  
> 
> Any help would be greatly appreciated.
> 
>  
> 
> Regards,
> 
> Sean
> 
>
----------------------------------------------------------------------
> For information about J forums see
> http://www.jsoftware.com/forums.htm
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to