Path: news.cs.au.dk!not-for-mail From: nospam2159@cs.au.dk (Peter von der =?iso-8859-1?q?Ah=E9?=) Newsgroups: comp.lang.beta Subject: Static vs. dynamic exceptions Date: 20 Jun 2000 11:51:16 +0200 Organization: Computer Science Department of the University of Aarhus Lines: 57 Message-ID: References: <20000619173848.8485.qmail@noatun.mjolner.dk> <8im02p$8s5j$1@xinwen.cs.au.dk> NNTP-Posting-Host: ufleku.cs.au.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: xinwen.cs.au.dk 961494676 214029 255.255.255.255 (20 Jun 2000 09:51:16 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 20 Jun 2000 09:51:16 GMT X-Attribution: Ahe User-Agent: Gnus/5.0806 (Gnus v5.8.6) Emacs/20.6 Xref: news.cs.au.dk comp.lang.beta:12451 >>>>> "JLK" == Jorgen Lindskov Knudsen writes: JLK> Just because the BETA exception model is not identical to the JLK> C++/Java exception handling model, does not imply that there is JLK> none :-) This is true. I just did not remember/know the terms static and dynamic exceptions. It does seem to me that every modern language support some kind of dynamic exceptions. It appears as if the reason for BETA only[1] supporting static exceptions is that leave and restart are limited (statically?/lexically?) in the Mjolner implementation. Are the limitations to leave and restart justified in the original language definition, or were they chosen because they were the most easily implemented? /Peter **** [1] Look at dynamic vs. static exceptions. It should be clear that dynamic exceptions can simulate static exceptions: try (# catch::(# (* handle syntaxerror *) #) do getint -> i #) which simulates: getint(# syntaxError::(# (* handle error *) #) #) -> i You could even write (might not be correct, but you should get the idea): -- streamlib: attributes -- getIntStaticEx: (# syntaxError:< exception; i: @integer do try (# catch:: (# do (if e // syntaxerror then syntaxError if) #) do getInt -> i #) exit i #) I do not believe that it is possible to simulate dynamic exceptions with static exceptions and if this is true one could say that dynamic exceptions is a proper superset of static exceptions. Please prove me wrong.