* local opening
@ 1998-02-24 8:50 Pierre CASTERAN
0 siblings, 0 replies; only message in thread
From: Pierre CASTERAN @ 1998-02-24 8:50 UTC (permalink / raw)
To: caml-list
Hello,
Is it possible to open a module inside a single expression ?
I tried :
module Compl=
struct
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))=
(a+.a',b+.b')
let mult(((a,b):compl),((a',b'):compl))=
(a*.a'-.b*.b',a*.b'+.b*.a')
end;;
let open Compl
in mult(i,i);;
but it produced a syntax error .
Is it possible to avoid an heavy :
Compl.mult(Compl.i,Compl.i);;
or a (global) opening of Compl ?
Best regards,
Pierre
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-02-24 15:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-24 8:50 local opening Pierre CASTERAN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox