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

Error trapping (Was: Beginner's questions on REBOL/Core and REBOL/Vi

 [1/3] from: kemp:extelligence at: 12-Sep-2002 0:10


Unless I'm way off, REBOL has a stack-based architecture to it - could we not have a Smalltalk-like walkback window that shows the call sequence, and what lines each call is related to (where they are related)? Clicking on a line item shows the context/state of all relevant store at that point. Very handy. Kemp

 [2/3] from: anton::lexicon::net at: 12-Sep-2002 15:03


We could probably make our own "line by line", or expression-by-expression interpreter. Check out do/next. Anton.

 [3/3] from: lmecir:mbox:vol:cz at: 12-Sep-2002 11:54


Hi Anton, I almost did, see the DEFAULT2 function I posted some time ago :-). But, seriously: 1) we are unable to handle crashes 2) we are unable to catch some errors (especially throw-errors) 3) do/next cannot handle cases like: do/next [ do [ lots-of-code-here ] ] with sufficient granularity. 4) it would really be better to traverse the interpreter stack: a: func [x] [1 / x] a 0 ** Math Error: Attempt to divide by zero ** Where: a ** Near: 1 / x I would prefer the message to be: ** Math Error: Attempt to divide by zero ** Near: 1 / x ** Where: a 0 Another (more complicated) example: a: func [f x] [f x] a func [x] [1 / x] 0 ** Math Error: Attempt to divide by zero ** Where: f ** Near: 1 / x Similarly as above, the two-level message I prefer would be: ** Math Error: Attempt to divide by zero ** Near: 1 / x ** Where: f x , but a three-level message: ** Math Error: Attempt to divide by zero ** Near: 1 / x ** Where: f x ** Where: a func [x] [1 / x] 0 would be more helpful in this case. Cheers -L ----- Original Message ----- From: "Anton" We could probably make our own "line by line", or expression-by-expression interpreter. Check out do/next. Anton.