> NB. for. T do. B end.
>
> i.3
> 0 1 2
>
> How does this work? When is 0 1 2 true? How often does "B" get
executed?
To understand how for. T do. B end. works you have to go to the specific
description for for., not just how T and B blocks work in general. The
code between for. and do. is a T block in the sense that that code will not
be considered as the result of the function. ("The final result is the
result of the last sentence executed that was not in a T block, ...")
On Thu, May 23, 2013 at 1:02 AM, Linda Alvord <[email protected]>wrote:
> perm=: 3 : 0
>
> z=. i.1 0
>
> for. i.y do. z=.,/(0,.1+z){"2 1\:"1=i.>:{:$z end.
>
> )
>
>
>
> perm 3
>
> 0 1 2
> 0 2 1
> 1 0 2
> 1 2 0
> 2 0 1
> 2 1 0
>
>
>
> NB. for. T do. B end.
>
>
>
> i.3
>
> 0 1 2
>
>
>
> How does this work? When is 0 1 2 true? How often does "B" get
> executed?
>
>
>
> Linda
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm