caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Philippe Wang <mail@philippewang.info>
To: Edgar Friendly <thelema314@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] OCaml linting
Date: Fri, 23 Nov 2012 18:30:06 +0100	[thread overview]
Message-ID: <CAAFfW_qEEqhpeKeTXbYiDd5OkqYfe7d9E_DGkJsO6gG_SoTJ4g@mail.gmail.com> (raw)
In-Reply-To: <50A6EBAD.8050204@gmail.com>

On Sat, Nov 17, 2012 at 2:43 AM, Edgar Friendly <thelema314@gmail.com> wrote:
> I'm playing with Sublime Text 2, and find it has an interesting plugin to do
> active linting of a program under development.  What's the set of compiler
> options that will produce warnings/errors the quickest, for using ocamlc to
> quickly check for syntax and maybe even type errors in a partial program?
> Does anyone already have a process for this under emacs, using
> auto-recompile or other plugins?
>
> Thanks,
> E.

I use ocamlc -i (or ocamlopt -i) so that it type-checks and prints the
interface.
If you have several files (hence there are dependancies especially for
interfaces), as said by Török Edwin, you should generate .cmi files.
If you have an .mli file, ocamlc -c can generate the corresponding .cmi file.
If you don't have an .mli file, you can either generate it (with
ocamlc -i) or produce the .cmi file directly from the .ml file (ocamlc
-c or ocamlc -c).

If ocamlc -i takes time, I believe it means that you have either a
super large .ml file, or you have expressions that take time to
type-check.

Cheers,

-- 
Philippe Wang
   mail@philippewang.info

      parent reply	other threads:[~2012-11-23 17:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-17  1:43 Edgar Friendly
2012-11-17  2:05 ` Wojciech Meyer
2012-11-17  8:35 ` Török Edwin
2012-11-23 17:30 ` Philippe Wang [this message]

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=CAAFfW_qEEqhpeKeTXbYiDd5OkqYfe7d9E_DGkJsO6gG_SoTJ4g@mail.gmail.com \
    --to=mail@philippewang.info \
    --cc=caml-list@inria.fr \
    --cc=thelema314@gmail.com \
    /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).