caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] about Obj.magic
@ 2002-05-30 21:09 dengping zhu
  2002-05-30 22:38 ` Jacques Garrigue
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: dengping zhu @ 2002-05-30 21:09 UTC (permalink / raw)
  To: Ocaml

Hi, all, 

When should I use 'Obj.magic'? It is really confusing. Now I am converting
a bunch of code from sml to ocaml. During the process, I want to make
sure that the type of every function keep consistent with the original
one. But I still encountered a lot of problems about the types in ocaml. 
For examples, all my base functions are fine in ocaml. But, sometimes when
I tried to combine a few base functions together in the same way as my
original code, I got a type error. After endless trial, I have to use
'Obj.magic'. In some sense, it is good because I can compile my code
now. On the other hand, things will be worse because it is very difficult
to debug if I use a few 'Obj.magic' in my code. I couldn't find out the
origins of all the runtime errors. 

So, we should be very careful to use 'Obj.magic'. Can somebody tell me
the appropriate situation to use this function?

Thanks a lot!

Dengping 



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2002-06-04 10:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-30 21:09 [Caml-list] about Obj.magic dengping zhu
2002-05-30 22:38 ` Jacques Garrigue
2002-05-31  4:00 ` Daniel de Rauglaudre
2002-05-31  5:37   ` Oleg
2002-05-31  6:17     ` Daniel de Rauglaudre
     [not found]       ` <p05100300b91cea02dbf5@[192.168.1.22]>
2002-05-31  9:50         ` [Caml-list] SML->OCaml (was: about Obj.magic) Daniel de Rauglaudre
2002-05-31 15:39   ` [Caml-list] about Obj.magic dengping zhu
2002-05-31 16:28     ` John D. Barnett
2002-06-01  8:37     ` Jacques Garrigue
2002-06-01 16:00       ` dengping zhu
2002-06-01 17:20         ` Pierre Weis
2002-05-31  9:17 ` Warp
2002-05-31 13:58   ` Jacques Garrigue
2002-05-31 14:06     ` Warp
2002-05-31 18:21       ` John Max Skaller
2002-06-01 17:42         ` Pierre Weis
2002-06-02 15:15           ` John Max Skaller
     [not found]           ` <D37FA3E3-763B-11D6-BE8F-0003938819CE@inria.fr>
2002-06-04 10:22             ` Pierre Weis
2002-05-31 14:10     ` Remi VANICAT
2002-05-31 16:19     ` Christophe TROESTLER
2002-05-31 18:06       ` Olivier Andrieu
2002-05-31 22:03         ` Christophe TROESTLER

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).