From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 561C07F02D for ; Sun, 19 Oct 2014 21:51:25 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.218.50; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.218.50 as permitted sender) identity=mailfrom; client-ip=209.85.218.50; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-oi0-f50.google.com) identity=helo; client-ip=209.85.218.50; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-oi0-f50.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj0BAH0VRFTRVdoym2dsb2JhbABBGoNhWASDArk1jWyBcIdOAoEHBxYBEQEBAQEBBgsLCRQuhAIBAQEDARIRBBkBGx4DAQsGBQcEDSoCAiIBEQEFARwGARIiiAgBAwkIDTeeb26LMIFygxCIEAoZJw1nhUoBAQEHAgEZAQUOkEqCd4FUBY9kgyODP4cTgTA8jV+CVoIMGCmDaIFFOy8BgkoBAQE X-IPAS-Result: Aj0BAH0VRFTRVdoym2dsb2JhbABBGoNhWASDArk1jWyBcIdOAoEHBxYBEQEBAQEBBgsLCRQuhAIBAQEDARIRBBkBGx4DAQsGBQcEDSoCAiIBEQEFARwGARIiiAgBAwkIDTeeb26LMIFygxCIEAoZJw1nhUoBAQEHAgEZAQUOkEqCd4FUBY9kgyODP4cTgTA8jV+CVoIMGCmDaIFFOy8BgkoBAQE X-IronPort-AV: E=Sophos;i="5.04,749,1406584800"; d="scan'208";a="83844692" Received: from mail-oi0-f50.google.com ([209.85.218.50]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Oct 2014 21:51:24 +0200 Received: by mail-oi0-f50.google.com with SMTP id i138so2732009oig.37 for ; Sun, 19 Oct 2014 12:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=DTWjMPafe25UbTV7lVrMkJAMj7TDYQcROVYcDhR47xE=; b=e5HtuDhcUtYmFLHI+lO/G7SqwMzHoT/B0XVw3YLQ6kT2l8VdvGTkx8WBietuIuLjAd gVSzeq60UrnWdLihGjtgqiZOa9vUgv6lzmQHHRdQFT7G9HHo3S/6MgDw/r/CytJakoRC Gu5/QaTP4EyOMRRRoQ9WxzMwivMtay+74wH394t+iF58h0zbc8EecNfKa4TBnpHkIPrl hQpNMuPZBlByGzLJJV86jp3Ln7EIsQXr0lmDeD2yfgbTd+tOKhN92ialme1pKuZCSWlA du8TuiqzdW3mrBMCI9/tnO4DYaNkTa+svLrPl8Vug5iXvlCfxmK5CCrRLxF71zMI6GSQ DgLA== X-Received: by 10.182.142.10 with SMTP id rs10mr3849424obb.36.1413748282629; Sun, 19 Oct 2014 12:51:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.105.196 with HTTP; Sun, 19 Oct 2014 12:50:42 -0700 (PDT) In-Reply-To: <54441347.904@coherentgraphics.co.uk> References: <5443FCE6.50206@coherentgraphics.co.uk> <54440936.3010001@coherentgraphics.co.uk> <54441347.904@coherentgraphics.co.uk> From: Gabriel Scherer Date: Sun, 19 Oct 2014 21:50:42 +0200 Message-ID: To: John Whitington , caml users Content-Type: multipart/alternative; boundary=001a11c2df343024f70505cbec80 Subject: Re: [Caml-list] ANN: exn-source - exception backtraces with source code printing --001a11c2df343024f70505cbec80 Content-Type: text/plain; charset=UTF-8 > > 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/ > > --001a11c2df343024f70505cbec80 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Done. = http://caml.inria.fr/mantis/view.php?id=3D6619<= br>

Thanks! Having an issue really helps tracking that things get done= .

there is one adv= antage to the current approach: no source code needs to=20 be changed in the simplest case (just searching '.') - we just link= =20 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 be= ing implemented as just
=C2=A0 let () =3D Exn_source.register= ()

Then simply making sure to pass= the flag -linkall when building that second cma means that explicitly requ= iring 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:
=C2=A0> perhaps it's just in need of clarification in the documentat= ion.

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=3D6619=

Note that a way to side-step this issue entirely would be for your API
to provide something in the style of Printexc.print
=C2=A0 =C2=A0handle : ('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, a= nd 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.cohere= ntpdf.com/


--001a11c2df343024f70505cbec80--