home *** CD-ROM | disk | FTP | other *** search
- 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
- From: jinx@zurich.ai.mit.edu (Guillermo J. Rozas)
- Newsgroups: comp.lang.scheme
- Subject: Re: wots going on here!?
- Message-ID: <JINX.92Aug29224406@chamarti.ai.mit.edu>
- Date: 30 Aug 92 02:44:06 GMT
- References: <1992Aug29.092113.12007@lugb.latrobe.edu.au>
- <JINX.92Aug29101908@chamarti.ai.mit.edu>
- <17o70sINNi2e@agate.berkeley.edu>
- <1992Aug30.004706.22131@pasteur.Berkeley.EDU>
- Sender: news@ai.mit.edu
- Reply-To: jinx@zurich.ai.mit.edu
- Organization: M.I.T. Artificial Intelligence Lab.
- Lines: 44
- In-reply-to: matt@volga.Berkeley.EDU's message of 30 Aug 92 00:47:06 GMT
-
- In article <1992Aug30.004706.22131@pasteur.Berkeley.EDU> matt@volga.Berkeley.EDU (Matt Wright) writes:
-
- | I agree that getting thrown into the debugger on errors is much
- | more of a nuisance than a help for a beginner. (Actually, for
- | people like me who generate lots of errors anyway with typos,
- | brainos, etc., I still don't want to get thrown into the debugger
- | unless I ask for it.)
-
- They do not get thrown into the debugger.
- They get thrown into a nested read-eval-print loop where they can
- evaluate ordinary expressions, etc., often in the context of the
- error.
-
- The debugger proper is invoked explicitly, and they can abort to the
- top-level read-eval-print loop simply by typing ^G (Control-G).
-
- For the courses that use Scheme, users (students) are typically asked
- whether they want to debug the error or abort directly to the ordinary
- REPL.
-
- | One system I've used that I like a lot is the one in Kyoto Common
- | Lisp---there's some global variable that says whether you want to be put
- | into the debugger; if it's false than a (possibly partial) stack trace is
- | printed on any error and you get a top-level REP loop.
-
- Just as an aside, remember that because of tail recursion, you may not
- have a stack trace at all in Scheme. This is one of the main
- arguments against requiring proper tail recursion in the language.
- However, this is infrequently the case in novice code, occurring most
- often in code written in CPS.
-
- The main reason that I personally don't like automatically aborting is
- because there is valid state at the point of the error that often
- allows me to find out what caused the error.
-
- I have often (as a TA) sat by students who on encountering an error
- immediately aborted to top-level, and proceeded to stare at the same
- code they had been staring at for hours, when a simple evaluation or
- cursory examination of the context of the error would have immediately
- guided them to the cause of the problem.
-
- Part of the problem is that we teach students to understand correct
- programs (and sometimes even to write or modify them), but not how to
- make them correct (i.e. debug) when they are not.
-