Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
local opening
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1998-02-24 (15:08)
From: Pierre CASTERAN <Pierre.Casteran@l...>
Subject: local opening


 Is it possible to open a module inside a single expression ?

 I tried :

module  Compl=
    type compl=float*float

    let compl(r:float)=(r,0.0)

    let i=(0.0,1.0)

    let add(((a,b):compl),((a',b'):compl))=

    let mult(((a,b):compl),((a',b'):compl))=

let open Compl 
  in mult(i,i);;

but it produced a syntax error .

Is it possible to avoid an heavy :


or a (global) opening of Compl ?

Best regards,