If the exercise is to find the index, remember the existing dyad verb i.
   9 4 6 i. 4
1

If the exercise is a tacit solution...
   idxof =: = # ([EMAIL PROTECTED]@[)
   9 4 6 idxof 4
1

NB: Does not handle a 'list' right argument (as indexOf also fails here)

   9 4 6 indexOf 4 9
|length error: indexOf
|   tally_map=:x    =y

.../Rob


On 9/10/07 10:08 PM, "metaperl.j" <[EMAIL PROTECTED]> wrote:

> 
> 
> 
> metaperl.j wrote:
>> 
>> tally_map =: value = y
>> 
> 
> Typo city. Here's the solution:
> 
> indexOf =: 4 : 0
> indices =: i. # x
> tally_map =: x = y
> tally_map # indices
> )


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to