<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/10/343ca705c5df0d0969aef5a79136c62c"
  from="rouanvd@s..."
  author="rouanvd@s..."
  date="2009-10-10T09:30:03"
  subject="Cannot access module members as unqualified"
  prev="2009/10/e7f2f5d4e0ff800e2527d4e93fdbed96"
  next="2009/10/e8e36f42040a988ae01a1722a9058a0c"
  next-in-thread="2009/10/66c5dd04f7232f31652121d7b88bc56b"
  prev-thread="2009/10/2a3b947aa9b77f6b0e4558b8fd0b4984"
  next-thread="2009/10/c17c0e6481804fa9249bde60a00584c2"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Cannot access module members as unqualified">
<msg 
  url="2009/10/343ca705c5df0d0969aef5a79136c62c"
  from="rouanvd@s..."
  author="rouanvd@s..."
  date="2009-10-10T09:30:03"
  subject="Cannot access module members as unqualified">
<msg 
  url="2009/10/66c5dd04f7232f31652121d7b88bc56b"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2009-10-10T14:43:07"
  subject="Re: [Caml-list] Cannot access module members as unqualified">
</msg>
</msg>
</thread>

<contents>
Hi everyone.

I am having trouble getting my modules to work together.

I have 2 modules :

============================================
module Preprocessor =
    struct

        let run txt =
            print_endline txt;
            txt ^ txt ;;

    end;;


module Main =
    struct

        open Preprocessor;;

        let main () =
            let text = "some text" in
            run text ;;

    end;;
============================================

I want to use the 'run' function unqualified, but i get a compilation
error:

Error: Unbound value run

when I qualify the run function with 'Preprocessor.' it works fine, but I
dont want to qualify the run function.

here are the commands that I use to compile the 2 modules:

============================================

#compile the Preprocessor module &amp; move to obj\ dir
ocamlc -c Preprocessor\Preprocessor.ml
move Preprocessor\*.c* build\obj\

#compile the Main module &amp; move to obj\ dir
ocamlc  -I build\obj\ -c Preprocessor.cmo Main.ml
move *.c* build\obj\

#link all object files to form executable
ocamlc -o build\bin\c.exe build\obj\Preprocessor.cmo build\obj\Main.cmo

============================================

Regards
Rouan

</contents>

</message>

