Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] re: help with ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Bauer, Robert <rbauer@r...>
Subject: [Caml-list] re: help with ocaml
Hi,

I have a little definition below written in ocaml.  My problem is that when
I define the class
lattice_point, I would have liked to specify the types of the parameters;
however, when I do so
I get an error - instead, I have to specify the types of the class's
attributes.  I am hoping that
someone can shed some light on this.

Also, I find that if try to use any capitalized variables, I get interesting
errors - for
example if I try let XYZ_ZYX = (false, false);; I get an error, whereas let
xyz_zyx = (false, false);;
works just fine. Or more simply, let XYZ = (false, false);; fails.  Again, I
am hoping for an explanation.

class lattice_point left right =
 object
  val mutable l:bool = left
  val mutable r:bool = right

  method get_l = l
  method get_r = r
end;;

let top_def = new lattice_point false false;;

Thanks.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr