You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 123 Reporter: administrator Assigned to:@xclerc Status: closed (set by @xavierleroy on 2011-05-29T10:20:27Z) Resolution: fixed Priority: normal Severity: feature Fixed in version: 3.11.2+dev Category: ~DO NOT USE (was: OCaml general) Has duplicate:#4477
val install_printer : (exn -> string option) -> unit
(* Install a pretty printer for some exceptions. The printer returns
[None] if it can not pretty-print the exception, or [Some s]
with the string corresponding to the exception. *)
printexc.ml:
let printers = ref []
let install_printer p = printers := p :: !printers
let to_string = function
....
| x ->
let rec iter list =
match list with
[] -> raise Not_found
| p :: tail ->
try
match p x with
None -> raise Not_found
| Some s -> s
with _ -> iter tail
in
try
iter !printers
with _ ->
let x = Obj.repr x in
let constructor = (Obj.magic(Obj.field (Obj.field x 0) 0) : string) in
constructor ^ (fields x)
The text was updated successfully, but these errors were encountered:
Original bug ID: 123
Reporter: administrator
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2011-05-29T10:20:27Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 3.11.2+dev
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #4477
Bug description
Full_Name: fabrice le fessant
Version: 3.00
OS: linux...
Submission from: cremant.inria.fr (128.93.8.143)
printexc.mli:
val install_printer : (exn -> string option) -> unit
(* Install a pretty printer for some exceptions. The printer returns
[None] if it can not pretty-print the exception, or [Some s]
with the string corresponding to the exception. *)
printexc.ml:
let printers = ref []
let install_printer p = printers := p :: !printers
let to_string = function
....
| x ->
let rec iter list =
match list with
[] -> raise Not_found
| p :: tail ->
try
match p x with
None -> raise Not_found
| Some s -> s
with _ -> iter tail
in
try
iter !printers
with _ ->
let x = Obj.repr x in
let constructor = (Obj.magic(Obj.field (Obj.field x 0) 0) : string) in
constructor ^ (fields x)
The text was updated successfully, but these errors were encountered: