From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: John Whitington <john@coherentgraphics.co.uk>,
caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] ANN: exn-source - exception backtraces with source code printing
Date: Sun, 19 Oct 2014 21:50:42 +0200 [thread overview]
Message-ID: <CAPFanBFQjOdQD_6JYopNJfu6=01ot24ExAPi+W_N2ikCDPc1aw@mail.gmail.com> (raw)
In-Reply-To: <54441347.904@coherentgraphics.co.uk>
[-- Attachment #1: Type: text/plain, Size: 2567 bytes --]
>
> Done. http://caml.inria.fr/mantis/view.php?id=6619
>
Thanks! Having an issue really helps tracking that things get done.
there is one advantage to the current approach: no source code needs to be
> changed in the simplest case (just searching '.') - we just link exn-source
> in.
> [...]
> So perhaps I should make it build exn-source.cm(x)a and exn-source-easy.cm(x)a,
> and have two choices.
>
Indeed. exn-source-easy (or -autolink) could simply depend on the "clean
API" in the exn-source library, by being implemented as just
let () = Exn_source.register ()
Then simply making sure to pass the flag -linkall when building that second
cma means that explicitly requiring it (in the build system) will enable
the feature.
On Sun, Oct 19, 2014 at 9:38 PM, John Whitington <
john@coherentgraphics.co.uk> wrote:
> Hi,
>
> Gabriel Scherer wrote:
>
>> > perhaps it's just in need of clarification in the documentation.
>>
>> My understanding is that uncaught exception raised by the handler are
>> dropped/ignored.
>> Would you mind creating a mantis issue ( http://caml.inria.fr/mantis/ )
>> so that we can discuss improving the documentation there?
>>
>
> Done. http://caml.inria.fr/mantis/view.php?id=6619
>
> Note that a way to side-step this issue entirely would be for your API
>> to provide something in the style of Printexc.print
>> handle : ('a -> 'b) -> 'a -> 'b
>> that handles any exception raised by the function application. Users
>> would be able to call this explicitly around their main processing loop
>> (which is the place where they often already handle exception-handling)
>> instead of delegating to a possibly-fragile mutable final handler.
>>
>> My understanding is that exn-source currently operates by a side-effect
>> at link-time. I would rather have the choice between an explicit (unit
>> -> unit) registration function, and a side-effect-free handling function
>> as above.
>>
>
> Correct. Your suggestion would be much cleaner, but there is one advantage
> to the current approach: no source code needs to be changed in the simplest
> case (just searching '.') - we just link exn-source in.
>
> People won't want to necessarily ship code with exn-source linked in, and
> it's not nice to have to modify code between debug and release -- I like to
> try to have those differences all in the build system.
>
> So perhaps I should make it build exn-source.cm(x)a and exn-source-easy.cm(x)a,
> and have two choices.
>
> Thanks.
>
>
> --
> John Whitington
> Director, Coherent Graphics Ltd
> http://www.coherentpdf.com/
>
>
[-- Attachment #2: Type: text/html, Size: 4323 bytes --]
next prev parent reply other threads:[~2014-10-19 19:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-19 18:03 John Whitington
2014-10-19 18:26 ` Gabriel Scherer
2014-10-19 18:55 ` John Whitington
2014-10-19 19:05 ` Gabriel Scherer
[not found] ` <54441347.904@coherentgraphics.co.uk>
2014-10-19 19:50 ` Gabriel Scherer [this message]
2014-10-20 9:15 ` Nicolas Boulay
2014-10-20 9:35 ` Peter Zotov
2014-10-20 11:52 ` John Whitington
2014-10-20 12:06 ` Peter Zotov
2014-10-20 12:15 ` Francois Berenger
2014-10-20 18:28 ` Török Edwin
2014-10-23 8:32 ` John Whitington
2014-10-23 11:48 ` Sébastien Hinderer
2014-10-23 16:43 ` Gabriel Scherer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPFanBFQjOdQD_6JYopNJfu6=01ot24ExAPi+W_N2ikCDPc1aw@mail.gmail.com' \
--to=gabriel.scherer@gmail.com \
--cc=caml-list@inria.fr \
--cc=john@coherentgraphics.co.uk \
/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