caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: rouanvd@softwarerealisations.com
To: caml-list@yquem.inria.fr
Subject: Cannot access module members as unqualified
Date: Sat, 10 Oct 2009 10:39:46 +0200 (SAST)	[thread overview]
Message-ID: <49676.41.177.16.252.1255163986.squirrel@41.177.16.252> (raw)

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 & move to obj\ dir
ocamlc -c Preprocessor\Preprocessor.ml
move Preprocessor\*.c* build\obj\

#compile the Main module & 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


             reply	other threads:[~2009-10-10  9:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-10  8:39 rouanvd [this message]
2009-10-10 14:43 ` [Caml-list] " Richard Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49676.41.177.16.252.1255163986.squirrel@41.177.16.252 \
    --to=rouanvd@softwarerealisations.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).