Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] ocamlc 4.03 -> 4.04: change in meaning of -i
@ 2017-07-08 14:08 Timothy Bourke
  2017-07-09  9:47 ` David Allsopp
  0 siblings, 1 reply; 3+ messages in thread
From: Timothy Bourke @ 2017-07-08 14:08 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]

I just noticed a change in the behaviour of ocamlc that adversely 
affects a tool I maintain.

In 4.03.0 (and earlier), the -i option only applies to the .ml files 
that follow it on the command line.

In 4.04.0 (and later), the -i option applies to all .ml files on the 
command line.

Is this change in behaviour intentional?

Tim.

Longer explanation
==================

Given two files.

  a.ml:
    let f x = x + 1

  b.ml:
    open A
    let g x = f x

1. In 4.03.0 (and earlier), typing either
     ocamlc a.ml -i b.ml
   or
     ocamlc -c a.ml; ocamlc a.ml -i b.ml

   prints
     val g : int -> int

   and generates
     a.cmi
     a.cmo

2. In 4.04.0 (and later), typing
     ocamlc a.ml -i b.ml

   prints
     val f : int -> int
     File "b.ml", line 1, characters 5-6:
     Error: Unbound module A    

   and does not generate anything.

3. In 4.04.0 (and later), typing
     ocamlc -c a.ml; ocamlc a.ml -i b.ml

   prints
     val f : int -> int
     val g : int -> int

   and generates
     a.cmi
     a.cmo


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-09 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-08 14:08 [Caml-list] ocamlc 4.03 -> 4.04: change in meaning of -i Timothy Bourke
2017-07-09  9:47 ` David Allsopp
2017-07-09 15:00   ` Timothy Bourke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox