Let's break this down...

t=:".{{)n
  3  1  4  1  2  1  1  8  8  3  6  7  3  3  4  3  6  4  2  1  8  2  7  7
 _6 _8 _5 _8 _7 _8 _8 _1 _1 _6 _3 _2 _6 _6 _5 _6 _3 _5 _7 _8 _1 _7 _2 _2
  0  0  0  0  0  0  0  1  1  0  1  1  0  0  0  0  1  0  0  0  1  0  1  1
}}-.LF

   9!:3(1 6 5 4)

   {:} }:
┌─────────────────┐
│┌─┬─────────────┐│
││2│┌────────┬──┐││
││ ││┌─┬────┐│}:│││
││ │││}│┌──┐││  │││
││ │││ ││{:│││  │││
││ │││ │└──┘││  │││
││ ││└─┴────┘│  │││
││ │└────────┴──┘││
│└─┴─────────────┘│
└─────────────────┘
({:} ) }:
{:}  }:
  ┌─ } ─── {:
──┴─ }:

(Or, you could run dissect on your expression.)

Anyways, the point here is that ({:} }:) is a hook with two verbs. The
first verb is {:} and the second verb is }:

That means that an equivalent expression would be
   t {:}  t2=. }: t

This, in turn, means that this expression needs to find the result of
t {: t2 -- but that result does not exist, and the expression instead
gives you a domain error.

I hope this helps,

-- 
Raul

On Fri, Dec 10, 2021 at 10:24 AM R.E. Boss <[email protected]> wrote:
>
> I'm trying to solve the AdventOfCode puzzles, but at least half of my time I 
> spend on troubles with J.
> Mostly I make mistakes, because the rules of J are less intuitive then I 
> presumed, but there is also inexplicable behavior, so in the end, J remains a 
> black box for me.
>
>   t
> 3  1  4  1  2  1  1  8  8  3  6  7  3  3  4  3  6  4  2  1  8  2  7  7
> _6 _8 _5 _8 _7 _8 _8 _1 _1 _6 _3 _2 _6 _6 _5 _6 _3 _5 _7 _8 _1 _7 _2 _2
>  0  0  0  0  0  0  0  1  1  0  1  1  0  0  0  0  1  0  0  0  1  0  1  1
>
>    ({:} }:)t
> |domain error
> |       ({:}}:)t
>
> obviously }} is interpreted as part of a direct definition, red in JQT, 
> despite my blank.
>
>   (}:}~ {:) t
> |domain error
> |       (}:}~{:)t
>
> black box in optima forma.
>
> Fortunately, as NUVOC mentions, } is a replacement of ( {"0 1&.|: ).
> But it cost me too much time, reason to timebox my efforts for AOC.
>
>
> R.E. Boss
> ----------------------------------------------------------------------
> 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