caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Frédéric Bour" <frederic.bour@lakaban.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] example from manual FTBFS
Date: Wed, 7 Sep 2016 12:41:29 +0200	[thread overview]
Message-ID: <b986202a-5913-5990-b75a-a8058e28ae55@lakaban.net> (raw)
In-Reply-To: <20160907103816.GA19537@topoi.pooq.com>

Your snippet of code is a signature, not a structure.
Try renaming tt.ml to tt.mli.

On 09/07/2016 12:38 PM, Hendrik Boom wrote:
> 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:
>
> hendrik@notlookedfor:~/dv/ocaml/parse/priority$ ocamlc tt.ml -o tt
> File "tt.ml", line 4, characters 0-5:
> Error: Syntax error
> hendrik@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.
>
> hendrik@notlookedfor:~/dv/ocaml/parse/priority$ ocamlc -version
> 4.01.0
> hendrik@notlookedfor:~/dv/ocaml/parse/priority$ which ocamlc
> /home/hendrik/.opam/4.01.0/bin/ocamlc
> hendrik@notlookedfor:~/dv/ocaml/parse/priority$
>
> -- hendrik
>
>

  reply	other threads:[~2016-09-07 10:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07 10:38 Hendrik Boom
2016-09-07 10:41 ` Frédéric Bour [this message]
2016-09-07 12:31   ` Hendrik Boom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b986202a-5913-5990-b75a-a8058e28ae55@lakaban.net \
    --to=frederic.bour@lakaban.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).