Loading ...
Sorry, an error occurred while loading the content.

how to open the type

Expand Messages
  • climb
    I want to use hashtable on my objects which all has a method get_string:string. but i can only write the code like these: module SeqHashType = struct type t=
    Message 1 of 1 , Nov 3, 2002
    • 0 Attachment
      I want to use hashtable on my objects which all has a method get_string:string.
      but i can only write the code like these:

      module SeqHashType =
      struct
      type t= <get_string:string >
      let equal s1 s2 = (String.uppercase s1#get_string =String.uppercase s2#get_string )
      let hash s = Strex.hash s#get_string
      end
      module SeqHashtbl = Hashtbl.Make (SeqHashType)

      surely it is not what i want . i have tried
      type t= <get_string:string ; ..>

      but i can not complie it , the complier says Unbound ..
      then how to open the type <get_string:string> in the module SeqHashType ?
      or it can not be opened at this situation ?

      i am a newbie and a little puzzled at open types.

      Best regards

      Yours
      climb
      onlyclimb@...
      2002-11-03
    Your message has been successfully submitted and would be delivered to recipients shortly.