home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / scheme / 2109 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  2.8 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!ucsbcsl!network.ucsd.edu!sdd.hp.com!think.com!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!jinx
  2. From: jinx@zurich.ai.mit.edu (Guillermo J. Rozas)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: wots going on here!?
  5. Message-ID: <JINX.92Aug29224406@chamarti.ai.mit.edu>
  6. Date: 30 Aug 92 02:44:06 GMT
  7. References: <1992Aug29.092113.12007@lugb.latrobe.edu.au>
  8.     <JINX.92Aug29101908@chamarti.ai.mit.edu>
  9.     <17o70sINNi2e@agate.berkeley.edu>
  10.     <1992Aug30.004706.22131@pasteur.Berkeley.EDU>
  11. Sender: news@ai.mit.edu
  12. Reply-To: jinx@zurich.ai.mit.edu
  13. Organization: M.I.T. Artificial Intelligence Lab.
  14. Lines: 44
  15. In-reply-to: matt@volga.Berkeley.EDU's message of 30 Aug 92 00:47:06 GMT
  16.  
  17. In article <1992Aug30.004706.22131@pasteur.Berkeley.EDU> matt@volga.Berkeley.EDU (Matt Wright) writes:
  18.  
  19. |   I agree that getting thrown into the debugger on errors is much
  20. |   more of a nuisance than a help for a beginner.  (Actually, for
  21. |   people like me who generate lots of errors anyway with typos,
  22. |   brainos, etc., I still don't want to get thrown into the debugger
  23. |   unless I ask for it.)
  24.  
  25. They do not get thrown into the debugger.
  26. They get thrown into a nested read-eval-print loop where they can
  27. evaluate ordinary expressions, etc., often in the context of the
  28. error.
  29.  
  30. The debugger proper is invoked explicitly, and they can abort to the
  31. top-level read-eval-print loop simply by typing ^G (Control-G).
  32.  
  33. For the courses that use Scheme, users (students) are typically asked
  34. whether they want to debug the error or abort directly to the ordinary
  35. REPL.
  36.  
  37. |   One system I've used that I like a lot is the one in Kyoto Common
  38. |   Lisp---there's some global variable that says whether you want to be put
  39. |   into the debugger; if it's false than a (possibly partial) stack trace is
  40. |   printed on any error and you get a top-level REP loop.
  41.  
  42. Just as an aside, remember that because of tail recursion, you may not
  43. have a stack trace at all in Scheme.  This is one of the main
  44. arguments against requiring proper tail recursion in the language.
  45. However, this is infrequently the case in novice code, occurring most
  46. often in code written in CPS.
  47.  
  48. The main reason that I personally don't like automatically aborting is
  49. because there is valid state at the point of the error that often
  50. allows me to find out what caused the error.
  51.  
  52. I have often (as a TA) sat by students who on encountering an error
  53. immediately aborted to top-level, and proceeded to stare at the same
  54. code they had been staring at for hours, when a simple evaluation or
  55. cursory examination of the context of the error would have immediately
  56. guided them to the cause of the problem.
  57.  
  58. Part of the problem is that we teach students to understand correct
  59. programs (and sometimes even to write or modify them), but not how to
  60. make them correct (i.e. debug) when they are not.
  61.