It's probably worth noting here that the {: here is used to grab the
last row of the partial result which is being built.

Initially, this is a list of y zeros, followed by a 1, followed by y zeros.

   ,: 1 (15)} (>:+:15) $ 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Note that there would be other ways of building this value, for example:
   15=i.1 31
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Anyways, next you have an expression of the form (, (...)@{:)^:15
which starts with the above as its initial value. So it's adding
another 15 rows. (Or... y instead of 15, for the general case.)

And, there, it's padding each row with an extra zero, grabbing every
adjacent set of three bits and using them to index into an eight bit
constant.

Hopefully this is close to the right number of clues?

Thanks,

-- 
Raul

On Tue, Feb 1, 2022 at 12:54 PM Brian Schott <schott.br...@gmail.com> wrote:
>
> Andrew, your observations are correct.
> Now consider this part which is an amend to create
> and amend a long list of zeroes.
>
>    1 (15)} (>:+:15) $ 0    NB. beware, of long result
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
>    $,:1 (15)} (>:+:15) $ 0   NB. ,: forces a new dimension
> 1 31
>
> Now consider the left-most part which is just a train of
> verbs and some nouns which are forced to behave like verbs in
> this context, (except for the first part: @{:). Such trains
> are called forks in J when they have 3 tines.
> Forks of 3 verbs can be symbolized V0 V1 V2 or if the
> V0 is a noun, symbolized N, then N is treated as if it is
> a verb and it is V0.
> Longer fork trains like V0 V1 V2 V3 V4 are processed from
> right to left and the result of the leftmost fork becomes
> the rightmost verb of the next fork to the left after the
> first fork is processed; so V0 V1 V2 V3 V4 is processed
> like V0 V1 (V2 V3 V4). In this case, the 3 is a leftmost noun
> in one of the forks, and the 0 to its right is another
> leftmost noun in a fork. Also the term (72#:~8#2) is a
> leftmost noun in a fork.
>
>    (, ((72#:~8#2){~3#.\0,],0:)@{:)
>
> The (, (....)) 2 verb train called a hook, which appends
> the hook's input to the result when the leftmost verb (.....)
> is applied to its own input.
>
>
> The ^:y term repeats the process y times.
>
> Maybe this give some more information, although it is rough.
> ----------------------------------------------------------------------
> 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