A bit late, but:

Interesting try, testing if J is a man or a boy! May be of some help,
here are a few observations:

I tried several smaller LHA's. Every time I get 5001 stack frames? Can
you confirm this?

The Python example sets a recursion depth of 1025

Profiling the Haskell example gives 722 iterations for function `a` (see
Haskell program) with argument 10.



ps I work with Linux so I don't know where to change values (if
possible) in libj.so and or libjnative.so.



Hallo Raul Miller, je schreef op 01-02-10 20:16:
> I think I have figured out what this task specification
> is asking for.  So I wrote some J code that I expect
> might work here.
>
> NB. http://rosettacode.org/wiki/Man_or_boy_test
>
> A=:4 :0
>   ctx=.cocreate''
>   B__ctx=:B
>   k__ctx=:x
>   '`x1__ctx x2__ctx x3__ctx x4__ctx x5__ctx'=:y
>   if.k__ctx<:0 do.a__ctx=:(x4__ctx + x5__ctx)'' else. ctx B '' end.
>   a__ctx
> )
>
> B=:4 :0
>   ctx=.x
>   k__ctx=:k__ctx-1
>   a__ctx=:k__ctx A ctx&B`x1__ctx`x2__ctx`x3__ctx`x4__ctx
> )
>
> 10 A 1:`_1:`_1:`1:`0:
>
> My problem is that this dies with a stack error.
>
> With debug turned on, #13!:13'' gives me 5001
> stack frames.
>
> So, searching jsoftware.com for pages dealing
> with this issue (I know that the stack limit can
> be lifted), I find:
>
> http://www.jsoftware.com/help/release/recurlim.htm
>
> So... first, I had to locate a copy of dumpbin and
> editbin.  And I am not sure what I should have been
> doing if I were running on linux or a mac.
>
> Eventually, I located a copy -- it is not a standard
> part of windows -- and then with some more work
> I addressed a problem where it could not find a
> .dll it needed.
>
> So, then, I tried editbin /stack:6000000 on my
> j.exe, but when I ran this code again, it still blew
> up with 5001 for #13!:13''.  So I tried changing the
> .dll again, this time changing the limit to 9000000
> but the coded died egain with the same size of
> stack.
>
> So... how should I address this kind of problem?
>
> Thanks,
>
>   

-- 
Met vriendelijke groet,
=@@i

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

Reply via email to