List Info

Thread: "ocaml_beginners"::[] Home-made initially opened module ?




"ocaml_beginners"::[] Home-made initially opened module ?
user name
2007-01-21 10:55:42


Hello all,

In my home-made Ocaml toplevel (created with ocamlmktop) I always start by typing the
command

open My_Pervasives;;

This module contains shortcuts values&;functions that I use
very frequently (such as let hd=List.hd, etc).

Is there a hack to create a toplevel that automatically opens
this module when launched, so that I don't have to re-type
the command above every time ? (AFAIK that's impossible, but
there's no harm in asking ...)

Ewan

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] Home-made initially opened module ?
user name
2007-01-21 12:05:05

On Sun, Jan 21, 2007 at 04:55:42PM -0000, roparzhhemon wrote:
>
> Hello all,
>;
> In my home-made Ocaml toplevel (created with ocamlmktop) I always start by typing the
> command
>
> open My_Pervasives;;

For Unix/Linux:
put that open-statement into a file called ".ocamlinit";
in your home-directory.

.ocamlinit will be used as if you have typed in the commands in this
file by hand.

Ciao,
Oliver

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] Home-made initially opened module ?
user name
2007-01-21 17:28:29

On Sun, 21 Jan 2007, roparzhhemon wrote:

>
> Hello all,
>;
> In my home-made Ocaml toplevel (created with ocamlmktop) I always start by typing the
> command
>
> open My_Pervasives;;
>
> This module contains shortcuts values&;functions that I use
> very frequently (such as let hd=List.hd, etc).
>
> Is there a hack to create a toplevel that automatically opens
> this module when launched, so that I don't have to re-type
> the command above every time ? (AFAIK that's impossible, but
> there's no harm in asking ...)

Initialization commands are read from a .ocamlinit file, see
http://caml.inria.fr/pub/docs/manual-ocaml/manual023.html
for the details.

Martin

--
Martin Jambon
http://martin.jambon.free.fr

__._,_.___
.

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

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