List Info

Thread: "ocaml_beginners"::[] question about using modules




"ocaml_beginners"::[] question about using modules
country flaguser name
United States
2007-07-20 22:33:42

Hi

When I try to use a module (in this case the module is from
ocamlgraph) using its full 'path' name I get a syntax error.
Eg:
module G = Imperative.Digraph.AbstractLabeled(IntInt)(Int)

let () =
let g = Imperative.Digraph.AbstractLabeled(IntInt)(Int).create () in
()

[sashanlocalhost search]$ ocamlfind ocamlopt -package ocamlgraph,str
-linkpkg -o keyword keyword.ml
File "keyword.ml";, line 42, characters 54-55:
Syntax error
[sashanlocalhost search]$

However if I do this:
module G = Imperative.Digraph.AbstractLabeled(IntInt)(Int)

let () =
let g = G.create () in
()

It compiles fine. Why is this?
--
sashan
http://sashang.orcon.net.nz/

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Ads on Yahoo!

Learn more now.

Reach customers

searching for you.

Yahoo! Groups

Join a yoga group

and take the stress

out of your life.

Re: "ocaml_beginners"::[] question about using modules
country flaguser name
United Kingdom
2007-07-21 01:50:22

On Saturday 21 July 2007 04:33:42 Sashan Govender wrote:
> Hi
>
> When I try to use a module (in this case the module is from
>; ocamlgraph) using its full 'path' name I get a syntax error.
> Eg:
> module G = Imperative.Digraph.AbstractLabeled(IntInt)(Int)
>
> let () =
> let g = Imperative.Digraph.AbstractLabeled(IntInt)(Int).create () in
> ()

Probably because this is a functor instantiation rather than an ordinary
module.

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?e

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )