* [Caml-list] First mandatory and safe use of Obj ? @ 2014-01-23 16:18 Christophe Raffalli 2014-01-23 20:53 ` Haoyang Wang 0 siblings, 1 reply; 3+ messages in thread From: Christophe Raffalli @ 2014-01-23 16:18 UTC (permalink / raw) To: Caml list [-- Attachment #1: Type: text/plain, Size: 300 bytes --] Hello, To recover the result type of a functor for which I can not yet write an argument, I end up writing~: module type MType = module type of MyFunctor (struct let env = Obj.magic 0 end) This works well and Obj.magic is never run ... But I or OCaml may miss a feature ? Cheers, Christophe [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] First mandatory and safe use of Obj ? 2014-01-23 16:18 [Caml-list] First mandatory and safe use of Obj ? Christophe Raffalli @ 2014-01-23 20:53 ` Haoyang Wang 2014-01-23 22:22 ` Christophe Raffalli 0 siblings, 1 reply; 3+ messages in thread From: Haoyang Wang @ 2014-01-23 20:53 UTC (permalink / raw) To: Christophe Raffalli; +Cc: Caml list > module type MType = module type of MyFunctor (struct let env = Obj.magic 0 end) > > This works well and Obj.magic is never run ... raise an exception instead? ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] First mandatory and safe use of Obj ? 2014-01-23 20:53 ` Haoyang Wang @ 2014-01-23 22:22 ` Christophe Raffalli 0 siblings, 0 replies; 3+ messages in thread From: Christophe Raffalli @ 2014-01-23 22:22 UTC (permalink / raw) To: Haoyang Wang; +Cc: Caml list [-- Attachment #1: Type: text/plain, Size: 497 bytes --] On 14-01-23 12:53:24, Haoyang Wang wrote: > > module type MType = module type of MyFunctor (struct let env = Obj.magic 0 end) > > > > This works well and Obj.magic is never run ... > > raise an exception instead? or assert false, I will do that. > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-23 22:22 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-01-23 16:18 [Caml-list] First mandatory and safe use of Obj ? Christophe Raffalli 2014-01-23 20:53 ` Haoyang Wang 2014-01-23 22:22 ` Christophe Raffalli
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox