On Sat, Apr 27, 2013 at 12:35 PM, Linda Alvord <[email protected]> wrote:
> Note that there are two instances of  ^: in the tree.

That's characteristic of an inductive (functional) loop.

The outer ^: is ^:_

The inner ^: has an atomic, truth valued n (0 or 1 times)

This turns the inner induction into a constant when the predicate
ceases to be satisfied, which in turn means it satisfies the outer
induction. In other words, it's a functional "while loop".

while=: 2 :'u^:v^:_'

For example, here's a very inefficient and awkward implementation of
>. which also has some structural issues (my predicate does not always
yield a 1 or a 0 - when it yields a sequence of them the limit case
has infinite dimensions).

   >: while (10 > ]) 1
10
   >: while (10 > ]) 20
20
   >: while (10 > ]) 1 2 3
|out of memory

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

Reply via email to