Hendrik Boom
2016-09-07 10:38:32 UTC
I took an example from
http://caml.inria.fr/pub/docs/u3-ocaml/ocaml-objects.html
class amateur : object ('a)
method play : 'a -> int -> 'a
end
class professional : object ('a)
method level : int
method play : 'a -> int -> 'a
end
and tried to compile it:
***@notlookedfor:~/dv/ocaml/parse/priority$ ocamlc tt.ml -o tt
File "tt.ml", line 4, characters 0-5:
Error: Syntax error
***@notlookedfor:~/dv/ocaml/parse/priority$
Those five characters are the word "class" on the second class
declaration. But it's not the word "class". If I leave that second
class declaration out, it still complains at the same point, at the
end of file after the first class declaration.
Evidently, I'm doing something wrong.
***@notlookedfor:~/dv/ocaml/parse/priority$ ocamlc -version
4.01.0
***@notlookedfor:~/dv/ocaml/parse/priority$ which ocamlc
/home/hendrik/.opam/4.01.0/bin/ocamlc
***@notlookedfor:~/dv/ocaml/parse/priority$
-- hendrik
http://caml.inria.fr/pub/docs/u3-ocaml/ocaml-objects.html
class amateur : object ('a)
method play : 'a -> int -> 'a
end
class professional : object ('a)
method level : int
method play : 'a -> int -> 'a
end
and tried to compile it:
***@notlookedfor:~/dv/ocaml/parse/priority$ ocamlc tt.ml -o tt
File "tt.ml", line 4, characters 0-5:
Error: Syntax error
***@notlookedfor:~/dv/ocaml/parse/priority$
Those five characters are the word "class" on the second class
declaration. But it's not the word "class". If I leave that second
class declaration out, it still complains at the same point, at the
end of file after the first class declaration.
Evidently, I'm doing something wrong.
***@notlookedfor:~/dv/ocaml/parse/priority$ ocamlc -version
4.01.0
***@notlookedfor:~/dv/ocaml/parse/priority$ which ocamlc
/home/hendrik/.opam/4.01.0/bin/ocamlc
***@notlookedfor:~/dv/ocaml/parse/priority$
-- hendrik
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs