On Fri, Jan 2, 2009 at 12:43 PM, Dan Bron <[email protected]> wrote: > Raul wrote: >> I did not know that it popped the stack twice for the case of :: > > The explanation of this behavior of :: is identical to the commonly > observed difference between: > 3 : 'try. throw. catcht. 0 end.' 'example' > > vs: > 3 : 'try. 3 :''throw.'' y catcht. 0 end.' 'example' > 0
3 :'3 :''throw.'' ' _ |syntax error | 3 :'3 :''throw.'' '_ The inner 3 : was syntactically invalid, and :: was able to catch that error. (The exception was never thrown because processing did not proceed that far.) Here's a demonstration that :: does not catch exceptions, even when the stack is two levels deep: 3 :'try.throw.catcht. 0 end.' 1 :'try.u y catcht. 1 end.' _ 1 3 :'throw.' 1 :'try.u y catcht. 1 end.' _ 1 3 :'throw.' ::1: _ 3 :'throw.' 1 :'u y' ::1: _ FYI, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
