Hi,

I've been working out some of the examples in the https://realworldocaml.org/v1/en/html/a-guided-tour.html, which does utilize JaneStreet 'core' library. The new ocaml website is very impressive, as it allows you to dive right in into very fascinating idiomatic ocaml expressions. Just launching ocaml toplevel though is not enough. 

let sum list =
  let sum  = ref 0 in
  List.iter list ~f:(fun x -> sum := !sum + x);
  !sum ;;
-: Error: The function applied to this argument has type 'a list -> unit
   This argument cannot be applied with label ~f

Jean


On Saturday, November 9, 2013 5:07 AM, Gabriel Kerneis <gabriel@kerneis.info> wrote:
On Fri, Nov 08, 2013 at 07:33:35PM -0800, Jean Saint-Remy wrote:
> I am running ocaml 3.12.1 and getting an error message. Is it an incompatible
> version error or a missing 'core' module?

Since you mention 'core', are you learning OCaml with "Real-World OCaml" (and
hence trying to use JaneStreet's Core library instead of the standard one)?
That would explain the discrepancy you are seeing.


Best,

--
Gabriel

--
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