Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Oo.copy
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] Oo.copy
> What's wrong with this code? When I try to compile it using ocamlc
> 3.06 the compiler hangs on Win32 and on Debian Linux as well. The
> ocaml interpreter does the same.
> 
> It works when I changed Oo.copy self to {<>} or simply self.
> 
> class virtual duplicatable =
>   object (_ : 'a)
>     method virtual dup : 'a
>   end
> 
> class test =
>   object (self)
>     inherit duplicatable
>     method dup = Oo.copy self
>   end

Looks like a bug.
But the CVS version chomps it happily, so this bug is already fixed
for the next release.
Anyway, it makes more sense to use {< >} to get a copy of self (the
meaning is just the same as Oo.copy self).

    Jacques Garrigue

-------------------
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