A more general and useful extension to J would be to have a latent expression
triggered by the return to immediate execution.
This would differ from 9!:26 in that it would be triggered on EVERY return
to immex, independent of 9!:28 . Alternatively,
9!:27 could be extended such that 9!:29[1 would be permitted as its final
evaluation, without causing an infinite loop. I've
wished for just such a facility a number of times in my J career.
But, for the sake of demonstration:
9!:27'smoutput ''return to immex'', '' premature'' ,~ '' NOT'' #~
flag_z_'
program =: 3 : '9!:29 flag_z_ =: 1 if. y do. flag_z_ =: 0 throw.
end. 99'
program 0
99
return to immex NOT premature
program 1
return to immex premature
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm