On 11/7/07, James C Field <[EMAIL PROTECTED]> wrote:
> Let's not forget that one of the reasons that Ken Iverson wrote the book
> (A Programming Language)  was  to regularise and codify the  description
> of  algorithms.
> GOTO is fundamental to the operation of any stored program computer. He
> HAD to include it in APL if only for completeness.

counterexample=:3 :0
  go=. 0
  line=. ". bind 'go=.go+1'
  goto=. ". @ ('go=.<:',":)
  while.do.select.go case.0 do.
    line''case.1 do. X=: 0
    line''case.2 do. if.X >2 do.goto 6 end.
    line''case.3 do. smoutput X
    line''case.4 do. X=:X+1
    line''case.5 do. goto 2
    line''case.6 do. smoutput 'done'
    line''case.7 do. i.0 0 return.
  end.end.
)

   counterexample''
0
1
2
done

You can do something similar with gerunds.

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

Reply via email to