Why avoid $:?

I do not know the definition of `:4 and am in too much of a hurry to
find it right now, but you can always use the name of the verb if you
want to do recursion. But this looks like a close approximation to
that algorithm:

(] , +/ @( _2&{. )@])^:(<:@[)&1 1

Or, if you want anonymous recursion you could use a y combinator
implementation (but this is going to be slow, in J, because
reinventing existing facilities is a sign that your efforts might best
be spent elsewhere).

There are a couple y combinator implementations at:
http://rosettacode.org/wiki/Y_combinator

Thanks,

-- 
Raul


On Sat, Nov 23, 2013 at 5:12 PM, Y-01 <[email protected]> wrote:
> Hi@all
>
> I just read an article Gerunds and Representations [Robert Bernecky and
> Roger Hui, 17 july 2007] (www.snakeisland.com/gerunds.ps) and stopped on
> searching bijection on J7 (or J6 or J8).
>
> Ok, lets go to the most interesting place ... page 6
>
> Fibonacci numbers
>
> cb  =. ] , +/ @( _2&{. )@]
> fib  =. >&1 ` (i.@>:) ` cb ` <: `:4
> fib 7
>
> 0 1 1 2 3 5 8 13
>
> 1. How can we write this in J7 (without $:-solution).?
> NB. without
> NB. fib =: 1:`1:`( (+/@:(_2&{.))@:($:"0 (<:@<: , <:) ) )@. (2&<.) "0
> NB. fib i.10
> NB. 1 1 2 3 5 8 13 21 34 55
>
> http://www.jsoftware.com/help/dictionary/d612.htm say that there are only:
>
> m `: 0   *Append*
>  m `: 3 *Insert*
>  m `: 6 *Train*
>
>
> 2. Does J looses `: 4 (recursive compute in such view) `:5 (case) `:1
> (until) in it's evolution?
> (replacement with @.)
>
> 3. Maybe there is an article or page about J-gerunds-evolution and it's
> nearest future?
>
> thnks
> ----------------------------------------------------------------------
> 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