[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: migration



Hi again,

The following class works:

# class p () =
  method migrate w = Join.go w
  end ;;
class p (unit) = method migrate : Join.location -> unit end

The only difference is putting in the argument. I have had the problem
before, and I think it is because if you don't put the argument, you
don't have a closure built. (this problem occurs only with
primitives). For instance, the following code results in a problem:

# class p () =
  method migrate w = Join.go w
    method ps = print_string 
  end ;;
class p (unit) =
  method migrate : Join.location -> unit
  method ps : string -> unit
end
# let obj = new p () ;;
val obj : p = <obj>
# obj#migrate w ;;
- : unit = ()
# obj#ps "toto" ;;

On the other machine, one gets:
# Final tag
OK, a channel ...
Size 2

which says in a not very nice way that you just received an alias on
some function. Putting method ps s = print_string s solves the
issue. I guess I should write something about this in the
documentation ...

Alan Schmitt

David Chemouil wrote:
>Alan Schmitt wrote:
>> - what happens if you don't put the method print in your code ?
>
>Same exception (here is the second machine code):
>
># Ns.user := "david";;      
>- : unit = ()
># let dest = Ns.lookup "destination" (vartype : Join.location
>metatype);;
>Warning: VARTYPE replaced by type 
> Join.location metatype
>Using multicast
>Multicast aborted (Failure("setsock_join"))
>Querying name server shiva:20001
>val dest : Join.location = <abstr>
># class p () =
>    method migrate = Join.go
>  end;;
>class p (unit) = method migrate : Join.location -> unit end
># let obj = new p ();;
>val obj : p = <obj>
># obj#migrate dest;;
>Uncaught exception: Failure("Go: migration of space location")
>
>
>dc
>
>-- 
>David Chemouil [mailto:chemouil@enseeiht.fr] [mobile: 06 84 16 26 65]
>
>Laboratoire d'informatique et de mathématiques appliquées (IRIT-INPT)


--
The hacker: someone who figured things out and made something cool happen.