Generating a map at compile time?

Constructors of extensible types like exn get refreshed when unmarshalled. So for instance

try raise Marshal.(from_string (to_string Not_found []) 0) with Not_found -> ()

an exception called Not_found but different from Stdlib.Not_found will get raised and will not be caught.

1 Like