though I found it tricky to write ad32 without boxes due to fills, I have
written essentially the same as your last line:
reduce =: 1 : (':'; 'u boxscan (<"_1 x), < y')
except yours is better because its tacit.
(i.5) + reduce (i.10) + reduce 5 0
60 55
but manipulating the boxes directly is necessary for ad32, which can operate on
partial parts of the file
ad32c =: ((65521 | {.@:] ({:@:] ,~ [ + +/@:}:@:]) [: +/\ [,~{:@:]) boxscan)
ad32=: 65521 | [: ({: ,~ <:@:+/) ad32c
ad32 ( ad32c |. 0 0 ; (1, a. i. 'Wik') ; a. i. 'ip') ;~ a. i.'edia'
4582 920
----- Original Message -----
From: Raul Miller <[email protected]>
To: Programming forum <[email protected]>
Cc:
Sent: Monday, August 25, 2014 3:15:48 PM
Subject: Re: [Jprogramming] Adler-32
On Mon, Aug 25, 2014 at 2:40 PM, 'Pascal Jasmin' via Programming
<[email protected]> wrote:
> boxscan can use any list of arguments as the x, and appends any
> shape as the y, as long x u y results in a shape "compatible with
> y" (more accurately compatible with future applications of x u
> result .
boxscan can use any list of arguments as long as they are boxed.
Assuming, of course:
boxscan=: ((&.>)/)(>@:)
To get the behavior you have describe here, I'd probably go with a
different definition. This is a bit closer:
1 :'>@:(u&.>/)@(, <)'
... but that still assumes x has been boxed already.
So perhaps:
1 :'>@:(u&.>/)@(<"_1^:(0=L.)@[,<@])'
Or, more simply, and closer to your description:
1 :'>@:(u&.>/)@(<"_1@[,<@])'
Or, at least... that is how I interpret what you are explaining to me.
Thanks,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm