On Mon, Apr 25, 2011 at 11:31 PM, Arthur Anger <[email protected]> wrote:
> I think I have seen successive requests for the value of one of these
> variables

I can reproduce this problem.

It's obscured, somewhat by the use of ? in your definition of nreg.
But nreg will only ever be 1 or 2.  When it is 2, the code fails
before assigning bdirs.  When it is 1, the problem becomes visible.

It looks to me as if the value behind bdysegs is sometimes being
mutilated by the parser.

Specifically, I had defined:
cmoutput=: smoutput@,&<

And then made some changes to your code, including:
smoutput savedata=: cdir;bdysegs
'bdirs' cmoutput bdirs=: (2* * cdir),: - -/"1 bdysegs

And I would get sessions that had stuff like this in it:

+---+---+
|0 2|0 2|
|   |2 2|
+---+---+
+-----+-------------------------------+
|bdirs|         0                    2|
|     |_159704896 _9223372036854775807|
+-----+-------------------------------+
|index error: csnake
|   turnal=:0>.(bi    {bturns)*travel*1+sep21
   savedata
+---+--------------+
|0 2|159884768 4096|
|   |        1    1|
+---+--------------+

But when I replaced cmoutput with smoutput@,&< the value in savedata
matched the double box of numbers displayed just before the index
error.

Thus, I am suspecting an uninitialized variable in the C
implementation of the parser.

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

Reply via email to