[gambit-list] gsi / error handling /debug-repl

symbolic expression symbolic.expression at gmail.com
Tue Jan 27 15:44:08 EST 2009


If I fire up gsi, I can do:


> (+ 1 (+ 2 'a))
*** ERROR IN (console)@3.6 -- (Argument 2) NUMBER expected
(+ 2 'a)
1> ,(c 3)
4


$ cat test.scm:
(eval '(+ 1 (+ 2 'a)))

$ gsi test.scm
*** ERROR -- (Argument 2) NUMBER expected
(+ 2 'a)
$

okay ... so gsi dies on me, I look into main.scm (in the gambit source, this
repl-debug function looks like what I wnat)

$ cat test2.scm
cat test2.scm
(define (my-eval x)
  (with-exception-catcher
   ##repl-debug
   (lambda ()
     (pp x)
     (eval x))))

(pp (my-eval '(+ 1 (+ 2 'a))))

$ gsi test2.scm
(+ 1 (+ 2 'a))
> ,(c 3)
3
$

I dislike this for two reasons. 1) I miss the error statement of: *** ERROR
-- (Argument 2) NUMBER expected
and 2) I get 3 instead of 4.

How can i correct these two? I suspect this is likely a 2 line fix since the
functionality already exists.

thanks!

-- 
-- symbolic expression
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090127/51f75d96/attachment.htm>


More information about the Gambit-list mailing list