From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q3D9JI3A000680 for ; Fri, 13 Apr 2012 11:19:18 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AssBACTvh0/RVdK2mGdsb2JhbABFpieRTAgiAQEBAQEICQ0HFCeCCQEBAQQSAhMZARsSCwEDDAYFCw0NISIBEQEFAQoSBhMSEIddAQMLC5saCowggnKFBAoZJwMKV4h2AQULkUwElWyBEYhFhQA9hAw X-IronPort-AV: E=Sophos;i="4.75,415,1330902000"; d="scan'208";a="153896024" Received: from mail-iy0-f182.google.com ([209.85.210.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 13 Apr 2012 11:19:12 +0200 Received: by iahk25 with SMTP id k25so6459171iah.27 for ; Fri, 13 Apr 2012 02:19:11 -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 :cc:content-type:content-transfer-encoding; bh=1+jpF+AVCDLdzELE/BKdDxtwvwIcwr7vpasMH1nlwPs=; b=zbMz8SsDUc5NZZHQzEU4HuyvIGnGOGL7x0w6hcVyHbvLrBpyJV0kWKAi/G3I+/GFM0 FkurUivvOhveR8P9ZNzw717QOUDYXQV5Kga4d0tF6M8gq+TrM414kyfNwEE+QF3T11W0 9W+oXmoWrkDBOu6L2jDtDcerlDa2U4oRpVI5nX7fYqk6wfx+pdNW7a/CPDC5yzS/l6/S ZyqGjUwcLcMqgj+rQGVpDP2459mN/Hg/HD8nuhL6F+1OfmUtiWhRSnMTNaWqZfuSKq/O uGCsWxl0F3EzmZofZExjRLjG0wJeYzhV1EXlAroUH7rcmsFSXalWNc5AmrZicI8USjGI xrlQ== Received: by 10.50.179.34 with SMTP id dd2mr708274igc.60.1334308751212; Fri, 13 Apr 2012 02:19:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.140.100 with HTTP; Fri, 13 Apr 2012 02:18:31 -0700 (PDT) In-Reply-To: <4F87EDFB.6090409@cs.unibo.it> References: <4F87EDFB.6090409@cs.unibo.it> From: Gabriel Scherer Date: Fri, 13 Apr 2012 11:18:31 +0200 Message-ID: To: Matthias Puech Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q3D9JI3A000680 Subject: Re: [Caml-list] Printexc.register_printer without catch It seems Printexc.register_printer affects the other Printexc.* functions, not the way the toplevel itself (or the runtime system more generally) handles uncaught exceptions. # Printexc.register_printer begin function Not_found -> Some "hello" | _ -> None end;; - : unit = () # (fun () -> raise Not_found) ();; Exception: Not_found. # Printexc.print (fun () -> raise Not_found) ();; Uncaught exception: hello Exception: Not_found. On Fri, Apr 13, 2012 at 11:12 AM, Matthias Puech wrote: > Hello, > > Is there a way to change printing of uncaught exceptions in the toplevel and > in (native/bytecode, 3.12) compiled code without wrapping the whole code in > a try ... with or in Printexc.catch? > > Printexc.catch's documentation says it is deprecated and that the runtime > system should be able to print exceptions the way they were registered with > Printexc.register_printer, yet > > # Printexc.register_printer begin function Not_found -> Some "hello" | _ -> > None end;; > # raise Not_found;; > Exception: Not_found. > > (* I would expect it to respond [Exception: hello] *) > > Do I miss something here? > Thanks in advance, >    -m > > -- > Caml-list mailing list.  Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >