I can reproduce this, but before I go into it, I want to clear something up.  You say 'delimiter d', but parse2 is an adverb, and so you are executing

(d parse2);.1

and d is not a delimiter argument to (parse2;.1) .

But I don't follow what m means in parse2, so perhaps d is a delimiter there.

Is d correct?

Henry Rich

On 7/30/2022 2:59 PM, Raul Miller wrote:
I'm running into a problem with :.1 which, when I simplify the code, disappears.

So, here's the problem in raw form:

    (TAB,' ') parseout sample1
+--+---+
|$r|1 2|
+--+---+
+---+-+
|+/d|2|
+---+-+
|assertion failure
|       (#r)=+/d

parseout=: {{
    d=. (=<./)y (1 i.~ -.@e.)S:0 m
    r=.d parse2;.1 y
    if. (#r) ~:+/d do.
      echo '$r';$r
      echo '+/d';+/d
      assert. (#r)=+/d
    end.
}}

parse2=: {{
   ({.y);<m parseout^:(*@#)}.y
}}

sample1=: cutLF {{)n
zeta
     beta
     gamma
         lambda
         kappa
         mu
     delta
alpha
     theta
     iota
     epsilon
}}

In other words, I expect parse2 to return a list of two boxes, and I
expect that the result of parseout would have one of these pairs for
each 1 in the delimiter sequence 'd'.

But that's not happening here.



--
This email has been checked for viruses by AVG.
https://www.avg.com

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

Reply via email to