English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Socket and Threads on windows
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-10 (16:24)
From: Juancarlo_Añez <juanca@s...>
Subject: OCAML Newby Question: unbound module?
I'm trying to write my first OCAML program. It will be a module that helps
handlings sets of path, like Apache Ant and WANT
(http://www.suigeneris.org/want) do.

Below is the first few lines of code I wrote. Whey I try to run it with
ocaml, I get:

"File "pattensets.ml", line 1, characters 0-11:
Unbound module Dumper"

Dumper.mil and dumper.ml are in the same directory.

What am I doing wrong?


open Dumper;;

type fileName = string;;

type path = fileName list;;

let rec extract_file_name = function
    | ([], name)        -> ([], name)
    | ('/'::tail, name) -> (tail, name)
    | (c::tail, name)   -> extract_file_name (tail, name @ [c])

let a = extract_file_name (['a';'b';'c'], [])
  prerr_endline (Dumper.dump a);;