Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Type-checking bug (or feature?) in O'Caml 1.06
@ 1997-11-18 18:57 Paul Stodghill
  1997-11-18 19:05 ` Paul Stodghill
  1997-11-19  9:24 ` Pierre Weis
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Stodghill @ 1997-11-18 18:57 UTC (permalink / raw)
  To: caml-list

[ Pardon, mais non français. ]

Something changed in the way that type checking is done between 1.05 and
1.06. Bug or feature?

% ~pidgin/sww/sparc-solaris/bin/ocamlc -v
The Objective Caml compiler, version 1.05
Standard library directory: /usr/u/pidgin/sww/sun4-solaris/lib/ocaml
% ~pidgin/sww/sparc-solaris/bin/ocamlc -c caml_map.mli
% ~pidgin/sww/sparc-solaris/bin/ocamlc -c caml_map.ml

% ~/usr/sparc-solaris/bin/ocamlc -v
The Objective Caml compiler, version 1.06
Standard library directory: /home/stodghil/usr/sparc-solaris/lib/ocaml
% ~/usr/sparc-solaris/bin/ocamlc -c caml_map.mli
% ~/usr/sparc-solaris/bin/ocamlc -c caml_map.ml
The implementation caml_map.ml does not match the interface caml_map.cmi:
Values do not match:
  val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit
is not included in
  val iter : ('a -> 'b -> 'c) -> ('a, 'b) t -> unit

Below are the relevant parts of the code that is causing the problem.
This code is taken directly from the compatibility library generated by
caml2cslV2.0.

>From caml_map.mli:
---------------------------------------------------------------------------
val iter: ('a -> 'b -> 'c) -> ('a, 'b) t -> unit
---------------------------------------------------------------------------

>From caml_map.ml:
---------------------------------------------------------------------------
let iter f m =
  let rec iter = function
    Empty -> ()
  | Node(l, b, r, _) ->
      iter l;
      f b.key b.data;
      List.iter (f b.key) b.prev;
      iter r
  in iter m.tree;;
---------------------------------------------------------------------------

-- 
Paul Stodghill <stodghil@cs.cornell.edu>
http://www.cs.cornell.edu/home/stodghil/home.html





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

end of thread, other threads:[~1997-11-19  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-18 18:57 Type-checking bug (or feature?) in O'Caml 1.06 Paul Stodghill
1997-11-18 19:05 ` Paul Stodghill
1997-11-19  9:39   ` Pierre Weis
1997-11-19  9:24 ` Pierre Weis

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