Utop sends "Alert deprecated: module Base.Format"

Hi,

On this page Real World OCaml, I tried to follow the instructions to :

  1. Install and set up opam
  2. Install librairies and tools
  3. Set up my editor (I use Emacs)

The step 2) asks me to execute this command :

opam install core core_bench utop

Then I have to set up “utop”, by creating the file "~/.ocamlinit ", and insert the following contents :

#require “core.top”;;
#require “ppx_jane”;;
open Base;;

The step 3) asks me to execute this commands :

opam install user-setup tuareg ocamlformat merlin
opam user-setup install

But when I launch “utop”, this message appears :

Welcome to utop version 2.13.1 (using OCaml version 4.13.1)!

File “/home/asalek01/.opam/4.13.1/lib/toplevel/topfind”, line 20, characters 12-33:
20 | let fmt = Format.make_formatter (fun _ _ _ → ()) (fun _ → ()) in
^^^^^^^^^^^^^^^^^^^^^
Alert deprecated: module Base.Format
[2016-09] this element comes from the stdlib distributed with OCaml.
[Base] doesn’t export a [Format] module, although the
[Caml.Format.formatter] type is available (as [Formatter.t])
for interaction with other libraries.

Does anyone knows why ?

AFAIR, either the recent version of base, or the recent version of core gives this deprecation. You should try to install the older versions of these libraries, and check.

Thank you for your response @Kakadu . By looking the content of the file “~/.ocamlinit”, I read this:

#require “core.top”;;
#require “ppx_jane”;;
open Base;;
(* ## added by OPAM user-setup for ocamltop / base ## 3ec62baf6f9c219ae06d9814069da862 ## you can edit, but keep this line )
#use “topfind”;;
(
## end of OPAM user-setup addition for ocamltop / base ## keep this line *)

Finaly, I decided to write the line “open Base;;” after “#use "topfind";;” :

#require “core.top”;;
#require “ppx_jane”;;
(* ## added by OPAM user-setup for ocamltop / base ## 3ec62baf6f9c219ae06d9814069da862 ## you can edit, but keep this line )
#use “topfind”;;
(
## end of OPAM user-setup addition for ocamltop / base ## keep this line *)
open Base;;

Then I relaunch “utop” and everything works :

Welcome to utop version 2.13.1 (using OCaml version 4.13.1)!

Findlib has been successfully loaded. Additional directives:
#require “package”;; to load a package
list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates “p,q,…”;; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads

utop[0]>