caml-list - the Caml user's mailing list
 help / Atom feed
* 
@ 2002-10-19 17:14 climb
  2002-10-20 20:04 ` [Caml-list] Alessandro Baretta
  0 siblings, 1 reply; 2+ messages in thread
From: climb @ 2002-10-19 17:14 UTC (permalink / raw)
  To: caml-list

 i am quite confused about the orgnization of source files.
i have programmed with java . java has a simple rule to orgnize files: one file contains one class(public) or interface, and name of the file and the class  must be identical.

As to Ocaml.
Does the file name of *.ml or mli has some similar relation ship with the content ?
  for example , in the on-line manul
  it says :
  if complie like this
  ocaml -c aux.mli
  ocaml -c aux.ml
  behaves exactly as if 
  module Aux: sig (* contents of aux.mli*) end = struct (*contents of aux.ml*) end;;
  in the toplevel
  that seems to imply the exsiting fo some relationship , but i still has these questions:
1) can many modules be write in just one file ? 
   maybe not , then how does classes?
  
2) Is the multi sigs with one struct  or multi structs  with one sig  compiled at a prper dependency can get the same result that like as in the toplevel?   should i write anther file to tell them how to assigning?

3) take set.ml and set.mli for example which defined one functor: Make and two sigs : S and OrderedType.  But when we use , we use this command    Set.Make(..).       "Set" here seem can only get from the name of the file. So it seems the file name determined the library name .  Then how about the noraml module (not functor) case that if i define a module A with a funtion a(), in file b.ml and b.mli, how can i refer to a() in module A.  A.a() or B.A.a() or B.a()? 

 
 

Best regards
            
              Yours
                         climb
                         onlyclimb@163.com
                         2002-10-20

 




-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-19 17:14 climb
2002-10-20 20:04 ` [Caml-list] Alessandro Baretta

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox