Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: UNTRAPPABLE ERROR!

From: robbo1mark:aol at: 26-Jun-2001 12:16

Chris, I wasn't making any assumptions, FATAL or otherwise, I just wanted to verify if anyone else had come across this kind of behaviour before I reported it to FEEDBACK, I'm not sure if your message was written prior to Holger's clarification / response which did concur that it was an interpreter error & NOT a REBOL error! type value, although he didn't seem to think that this was correct & would investigate. My main concern was has anyone else discovered these kind of undocumented errors? & if so do they have examples? oh, that and also to try to be a helpful REBOL. that was all, cheers, Mark Dickson In a message dated Tue, 26 Jun 2001 10:16:14 AM Eastern Daylight Time, Chris <[chris--starforge--demon--co--uk]> writes: << [Robbo1Mark--aol--com] wrote:
> Has anybody else seen this problem or anything similar before?
I think what you're doing is making a fatal assumption about the nature of errors in REBOL. REBOL can't do the same thing as, say, a C compiler otherwise it could report the /lines/binary error before the script even started. gcc can pick up things like "too many arguments" problems during the compilation process but REBOL interprets on the fly - it can't do that. Normal errors are "runtime exceptions" - incorrect values appearing somewhere and so on. These are non-fatal problems that can be overcome programatically via a try/disarm construct. They are "correct" programs which generate an exceptional result. The error you have hit upon is something more drastic - a low level interpreter exception. This simply can not be caught and handled because you're trying to tell the interpreter to do something that, while syntactically correct, is logically and physically incorrect. Do you know Java? Java has a very strange, but ultimately sensible, exception system: All subclasses of Exception must either be caught using a try{}catch(){} construct where they are thrown or the method in which the exception occurs must declare that it "throws" the exception and the handling is passed up to the next level in the program. There is an exception to this rule however: RuntimeExceptions do not have to be caught and the "throws" is not needed for them - they cover things like ArrayIndexOutOfBoundsException, NullPointerException and other "This was caused by a Bug" exceptions. These should generally not be caught as they indicate a serious - possibly unrecoverable - problem in your program. The situation in REBOL is similar - normal errors - Exceptions - can be caught and handled with impunity because they will often be intended or expected. They may indicate a problem has occured in the program, but it's a problem you expect and know how to fix. Interpreter RuntimeException errors - like the /lines/binary one - are an indication of a serious bug in your code that should stop the script working until it is fixed. Chris -- New sig in the works Explorer2260 Designer and Coder http://www.starforge.co.uk