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

Re: Problems using mobile agents




Hi,

  The tutorial you have used is not really finished, many errors are
still not fixed. In particular, the correct example should be:

let loc mobile
  do {
       let here = Ns.lookup "here" vartype in
       go
here;
       let sqr = Ns.lookup "square" vartype in
       let def sum (s, n) =
reply (if n = 0 then s else sum (s+sqr n, n-1)) in
       let result = sum
(0,5) in
       print_string ("q: sum 5 = "^string_of_int result^"\n");

flush stdout;
    }

The error came from the forgotten "vartype" keyword required after the
Ns.lookup and Ns.register to specify the type of the data.

Regards,

- Fabrice Le Fessant