unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Neil Jerram" <neiljerram@googlemail.com>
To: "Derek Peschel" <dpeschel@eskimo.com>
Cc: guile-devel@gnu.org
Subject: Re: Evaluating (exit) in the debugger
Date: Sun, 23 Nov 2008 22:24:09 +0000	[thread overview]
Message-ID: <49dd78620811231424s4d837dd7s1fb4d5e62daf626@mail.gmail.com> (raw)
In-Reply-To: <20081120164832.A7356@eskimo.com>

Hi Derek,

I'm sorry that my followups to you are so slow, and hope that this
hasn't resulted in unnecessary work...

2008/11/21 Derek Peschel <dpeschel@eskimo.com>:
> On Fri, Nov 21, 2008 at 12:09:18AM +0000, Neil Jerram wrote:
>> I'm afraid I don't understand.  What do you want to happen when you
>> type "e (exit)"?
>
> I want Guile to exit, just as normally happens when you call (exit).
>
> Also return codes should be supported in the debugger as in the REPL,
> e.g. "e (exit 5)" should return 5 to the calling UNIX process.

(primitive-exit RETURN-CODE) will do both of those.

I'm afraid I can't remember why (exit ...) in Guile is actually just
(throw 'quit ...), but it's been that way for a long time now, so
might be difficult to change.

> The principle is that the debugger should not interfere with the
> actions of code it's debugging, which to me includes "e"'d code.

Interesting.  But on the other hand, we don't want unintended errors
in "e"'d code to propagate back into the actual program!  Is there any
nice general way of distinguishing between intentional exceptions
(which should not be caught by eval-handler) and unintended ones
(which should be)?

> And I need to work out how many levels of handler are running when the
> evaluation happens.  I wonder if Guile can tell me that?

It's possible in principle, but I don't believe we currently have a
primitive to expose this (i.e. the value of scm_i_dynwinds ()) to the
Scheme level.  If we did expose this, I think we should do so in a way
that still allows us to change the internal representation of the wind
list, without any back-compatibility problems.

Regards,
       Neil




      parent reply	other threads:[~2008-11-23 22:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20  0:53 Evaluating (exit) in the debugger Derek Peschel
2008-11-21  0:09 ` Neil Jerram
2008-11-21  0:48   ` Derek Peschel
2008-11-21  9:58     ` Derek Peschel
2008-11-21 21:14       ` Derek Peschel
2008-11-23 22:24     ` Neil Jerram [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49dd78620811231424s4d837dd7s1fb4d5e62daf626@mail.gmail.com \
    --to=neiljerram@googlemail.com \
    --cc=dpeschel@eskimo.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).