* changing the name of an imported module
@ 2008-06-15 4:53 Michael Vanier
2008-06-15 11:17 ` [Caml-list] " Stéphane Glondu
2008-06-15 11:27 ` Christophe TROESTLER
0 siblings, 2 replies; 5+ messages in thread
From: Michael Vanier @ 2008-06-15 4:53 UTC (permalink / raw)
To: caml-list
Hi everyone,
Is there any way in Ocaml to change the name of an imported module, sort of like Haskell's "import
qualified" or Python's "import foobar as f"? It's certainly something I could use.
Mike
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] changing the name of an imported module
2008-06-15 4:53 changing the name of an imported module Michael Vanier
@ 2008-06-15 11:17 ` Stéphane Glondu
2008-06-15 11:27 ` Christophe TROESTLER
1 sibling, 0 replies; 5+ messages in thread
From: Stéphane Glondu @ 2008-06-15 11:17 UTC (permalink / raw)
To: Michael Vanier; +Cc: caml-list
Michael Vanier wrote:
> Is there any way in Ocaml to change the name of an imported module, sort
> of like Haskell's "import qualified" or Python's "import foobar as f"?
> It's certainly something I could use.
What about module F = Foobar?
Cheers,
--
Stéphane Glondu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] changing the name of an imported module
2008-06-15 4:53 changing the name of an imported module Michael Vanier
2008-06-15 11:17 ` [Caml-list] " Stéphane Glondu
@ 2008-06-15 11:27 ` Christophe TROESTLER
2008-06-16 4:31 ` Michael Vanier
1 sibling, 1 reply; 5+ messages in thread
From: Christophe TROESTLER @ 2008-06-15 11:27 UTC (permalink / raw)
To: mvanier; +Cc: caml-list
On Sat, 14 Jun 2008 21:53:32 -0700, Michael Vanier wrote:
>
> Is there any way in Ocaml to change the name of an imported module,
> sort of like Haskell's "import qualified" or Python's "import foobar
> as f"? It's certainly something I could use.
module U = Unix
will allow to use U.f instead of Unix.f
Cheers,
ChriS
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] changing the name of an imported module
2008-06-15 11:27 ` Christophe TROESTLER
@ 2008-06-16 4:31 ` Michael Vanier
2008-06-16 14:47 ` Christophe TROESTLER
0 siblings, 1 reply; 5+ messages in thread
From: Michael Vanier @ 2008-06-16 4:31 UTC (permalink / raw)
To: Christophe TROESTLER; +Cc: caml-list, steph
Thanks! That's just what I need. Do you know if there is any performance cost to using e.g. U.f
instead of Unix.f? I wouldn't think so.
Mike
Christophe TROESTLER wrote:
> On Sat, 14 Jun 2008 21:53:32 -0700, Michael Vanier wrote:
>> Is there any way in Ocaml to change the name of an imported module,
>> sort of like Haskell's "import qualified" or Python's "import foobar
>> as f"? It's certainly something I could use.
>
> module U = Unix
>
> will allow to use U.f instead of Unix.f
>
> Cheers,
> ChriS
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] changing the name of an imported module
2008-06-16 4:31 ` Michael Vanier
@ 2008-06-16 14:47 ` Christophe TROESTLER
0 siblings, 0 replies; 5+ messages in thread
From: Christophe TROESTLER @ 2008-06-16 14:47 UTC (permalink / raw)
To: mvanier; +Cc: caml-list
On Sun, 15 Jun 2008 21:31:37 -0700, Michael Vanier wrote:
>
> Do you know if there is any performance cost to using e.g. U.f
> instead of Unix.f? I wouldn't think so.
The generated assembly code (ocamlopt -S) is not exactly the same but
my take is that the speed difference, if any, is negligible.
Regards,
ChriS
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-16 14:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-15 4:53 changing the name of an imported module Michael Vanier
2008-06-15 11:17 ` [Caml-list] " Stéphane Glondu
2008-06-15 11:27 ` Christophe TROESTLER
2008-06-16 4:31 ` Michael Vanier
2008-06-16 14:47 ` Christophe TROESTLER
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox