unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
Subject: Re: Backtrace and enhanced catch
Date: Wed, 18 Jan 2006 23:08:21 +0000	[thread overview]
Message-ID: <87mzhti17e.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87hd84pnxk.fsf@laas.fr> ( Ludovic Courtès's message of "Mon, 16 Jan 2006 09:38:47 +0100")

ludovic.courtes@laas.fr (Ludovic Courtès) writes:

> Hi,
>
> Better late than never...  ;-)

Absolutely!

> Neil Jerram <neil@ossau.uklinux.net> writes:
>
>> Another (lesser) problem with lazy-catch and with-exception-handler is
>> that they are always used in practice in a particular pattern. [...]
>
> OTOH, this would suggest that `lazy-catch' and `call/cc' are all we need
> to implement `catch'.

Theoretically, perhaps.  But if you accept the gist of my analysis,
that would be to build something that has nice clear semantics (catch)
on top of something that has rather awkward semantics (lazy-catch),
which doesn't seem sensible.

And for Guile (as a particular Scheme implementation) there is a
further reason against this, namely the runtime cost of call/cc.
catch in Guile is much more efficient than code using call/cc to do
the same thing.

>  This is probably the reason why SRFI-34 defines
> no construct equivalent to `catch'.

Actually it does; the `guard' syntax is pretty close to catch.

(BTW, in connection with `guard', which was called `try' in the
original draft of SRFI 34, I came across this email in the discussion
archive: http://srfi.schemers.org/srfi-34/mail-archive/msg00013.html.
This email concludes:

    Robust and portable code should only use the "try" form.

for reasons connected to how dynamic state is handled that I think are
similar to the reasoning in my analysis.

If accepted, this conclusion leaves SRFI-34 incomplete, because
try/guard provides no way of running something in the context of the
original error.)

>>From a theoretical viewpoint, it seems to me that it would make sense to
> just keep `lazy-catch' as a primitive and have `catch' implemented as a
> macro on top of it.  Now, from Guile's implementation viewpoint, I guess
> it would be much more costly/complex as you said.

Yes; as well as my points above, we'd like to have something that is
easy to use in the C API.

> Anyway, thanks for your patch: it's nice to see this issue is going to
> be fixed! ;-)  And sorry for not replying earlier.

Thanks for your comments.

       Neil



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2006-01-18 23:08 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01  0:16 gh_inexact_p error in 1.7.x Bruce Korb
2005-12-01  0:44 ` Kevin Ryde
2005-12-05  4:08   ` No way out Bruce Korb
2005-12-05  4:35     ` Bruce Korb
2005-12-07  1:31       ` Marius Vollmer
2005-12-05 22:20     ` Kevin Ryde
2005-12-06 10:58       ` Han-Wen Nienhuys
2005-12-28 15:59         ` Neil Jerram
2005-12-31 15:09           ` Han-Wen Nienhuys
2005-12-31 15:14             ` Neil Jerram
2006-01-01 19:58               ` Han-Wen Nienhuys
2006-01-02 15:42                 ` Neil Jerram
2006-01-02 18:54                   ` Neil Jerram
2006-01-04 21:13                     ` Backtrace and enhanced catch Neil Jerram
2006-01-14 12:41                       ` Neil Jerram
2006-01-22 13:47                         ` Marius Vollmer
2006-01-23 20:11                           ` Neil Jerram
2006-01-24 21:34                             ` Marius Vollmer
2006-01-16  8:38                       ` Ludovic Courtès
2006-01-18 23:08                         ` Neil Jerram [this message]
2006-01-19  9:38                           ` Ludovic Courtès
2006-01-21 11:26                             ` Neil Jerram
2006-01-26 23:29                       ` Kevin Ryde
2006-01-27 19:30                         ` Neil Jerram
2006-01-31 20:07                           ` Kevin Ryde
2006-02-01 23:04                             ` Neil Jerram
2006-02-04  0:46                               ` Kevin Ryde
2006-02-04 15:41                                 ` Neil Jerram
2005-12-07  1:07     ` No way out Marius Vollmer
2005-12-07  1:55       ` Rob Browning
2005-12-13 20:32         ` Marius Vollmer
2005-12-28 16:09       ` Neil Jerram

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=87mzhti17e.fsf@ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    /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).