[Jprogramming] try. catch. catchd. question
Brian Schott
schott.brian at gmail.com
Sun Feb 11 01:47:06 HKT 2007
No, I see your point. And a slightly changed
example.
f=: 4 : 0
try.
try. 3+y catch. *:x catchd. %:x end.
catch.
'x and y are both bad'
end.
)
13 f 'a'
169
13!:0[0
13 f 'a'
169
13!:0[1
13 f 'a'
|domain error: f
| 3 +y
|f[:1]
On Sat, 10 Feb 2007, Brian Schott wrote:
+ Bill,
+
+ I do not read any precedence into the catch.es .
+ Rather as I read it, if the catchd. does not apply
+ because 13!:0]1 then the error will not be caught and
+ therefore it will trigger a system error message rather than
+ performing the alternative action.
+
+
+ On Sat, 10 Feb 2007, bill lam wrote:
+
+ + for the verb,
+ +
+ + f=: 4 : 0
+ + try.
+ + try. 3+y catchd. *:x catch. %:x end.
+ + catch.
+ + 'x and y are both bad'
+ + end.
+ + )
+ +
+ + 13 f 'a'
+ + 3.60555
+ + 13!:0[1
+ + 13 f 'a'
+ + |domain error: f
+ + | 3 +y
+ + |f[:1]
+ +
+ + If I read correctly, precedence is: catch > catchd > catcht, so that the catch
+ + clause alone will trap all error no matter if there are catchd or catcht or
+ + debug flag. Also, at most one catch/catchd/catcht clause will be invoked. Am I
+ + missing thing?
+ +
+ + --
+ + regards,
+ + bill
+ + ----------------------------------------------------------------------
+ + For information about J forums see http://www.jsoftware.com/forums.htm
+ +
+
+ (B=) <----------my "sig"
+
+ Brian Schott
+ Atlanta, GA, USA
+ schott DOT bee are eye eh en AT gee em ae eye el DOT com
+ http://schott.selfip.net/~brian/
+
(B=) <----------my "sig"
Brian Schott
Atlanta, GA, USA
schott DOT bee are eye eh en AT gee em ae eye el DOT com
http://schott.selfip.net/~brian/
More information about the Programming
mailing list