Referencing symbols in different files

Pankrath <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <32340566.jBc5NvIoGW@akela>
Hello everyone,

I'm looking into LLVM and since one of the Kaleidoscope tutorials [1] is
written in OCaml, I thought it would be a good opportunity to a have 
a look at OCaml, too. Now I've got the example code on their page and
wanted to play with it in the REPL. 

However this does not work using »#use«:

tobias@akela ocaml [i] % ocaml
        OCaml version 4.01.0

# #load "dynlink.cma";;
# #load "camlp4o.cma";;
        Camlp4 Parsing version 4.01.0

# #use "token.ml";;
type token =
    Def
  | Var
  | Record
  | Type
  | For
  | If
  | Then
  | Else
  | End
  | While
  | Ident of string
  | Number of float
  | Operand of string
  | Kwd of char
# #use "lexer.ml";;
File "lexer.ml", line 23, characters 43-50:
Error: Unbound module Token

Since token is not defined in some module Token anymore. 
How can I load this code in REPL correctly and how does ocamlc.opt
know that token.ml constitues a module Token. By filename?

I tried using »#load« with token.cmo, too. But that didn't work either.

# #load "token.ml";;
File token.ml is not a bytecode object file.
# #load "_build/token.cmo";;
# Token.Kwd 'c';;
Error: Unbound module Token
# 

Thank you for your help,
Tobias

[1] http://llvm.org/docs/tutorial/OCamlLangImpl3.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.