I'm trying to use comp0 and comp1 on an array of boxes, but I'm encountering 
length errors everywhere.
The box array is called d.
Basically, for each item of {:d I want to do (}:d)&comp0:

   (}:d) comp&.>"1 0 {:d
|length error: comp0
|   (}:d)    comp0&.>"1 0{:d

I assume I am not using the combination of rank and each properly.

On 11 Nov 2011, at 23:54, Raul Miller wrote:

> split looks like either 0 100&#: or 100&#.inv
> 
> g depends on f and you did not define f
> 
> Anyways, you might want:
>   1234 5678 (+./"1@e.&(100&#.inv) # [) 3456
> 1234 5678
> 
> Or:
>   G=: +./"1@e.&(100&#.inv) # [
>   1234 5678 G 3456
> 
> FYI,
> 
> -- 
> Raul
> 
> 
> On Fri, Nov 11, 2011 at 6:41 PM, David Vaughan
> <[email protected]> wrote:
>> I have a verb split:
>> 
>>   split =: <.@%&100 , 100&|
>>   split 1234
>> 12 34
>> 
>> I want to compare numbers to see if one of their 'split regions' (e.g. 12 or 
>> 34) matches a given number.
>> So far I have:
>> 
>>   ]g =. 13 :'(f y) = (f"0 x)'
>> ([: f ]) = [: f"0 [
>>   1234 5678 g 3456
>> 0 1
>> 1 0
>> 
>> I want to make that actually return the numbers that matched, i.e.
>> 
>> 1234
>> 5678
>> 
>> I can't seem to get a working solution for this.
>> 
>> Any help appreciated, thanks.
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

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

Reply via email to