еще раз я
код:
class c = object (self)
val v = self;
val s = "test";
method get_s () = s;
end;;
let _ =
let i = new c
in print_endline (i#get_s ());;
ocamlc ./test.ml
File "./test.ml", line 2, characters 10-15:
The instance variable self
cannot be accessed from the definition of another instance variable
вопрос: есть способ получить доступ к self при определении переменной?
--
-- via knode --
Posted via RSDN NNTP Server 2.1 beta