From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA22256 for caml-redistribution; Tue, 6 Apr 1999 18:35:12 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA04062 for ; Tue, 6 Apr 1999 11:31:36 +0200 (MET DST) Received: from transbay.net (dns1.transbay.net [209.133.53.2]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id LAA17344 for ; Tue, 6 Apr 1999 11:31:32 +0200 (MET DST) Received: from kronstadt.transbay.net (ip55243.transbay.net [209.133.55.243]) by transbay.net (8.9.1/8.8.8) with ESMTP id CAA18516 for ; Tue, 6 Apr 1999 02:32:50 -0700 (PDT) (envelope-from itz@transbay.net) Received: (from itz@localhost) by kronstadt.transbay.net (8.8.6/8.8.6) id BAA03171; Tue, 6 Apr 1999 01:43:21 -0700 Sender: weis To: caml-list@inria.fr Subject: Re: Toplevel script mode From: Ian T Zimmerman Date: 06 Apr 1999 01:43:20 -0700 Message-ID: X-Mailer: Gnus v5.3/Emacs 19.34 Right after sending off my preceding message I stepped into the shower and immediately I had another brilliant idea :-) Why not make the initfile name mutable, then user extensions can load a different one (if they change the ref in the files they link). Patch is cummulative: --- /home/itz/toploop.ml Tue Apr 6 00:57:59 1999 +++ /usr/src/ocaml-2.02/toplevel/toploop.ml Tue Apr 6 01:32:49 1999 @@ -271,8 +271,11 @@ Clflags.thread_safe := true; Compile.init_path() +let initfile_name = + ref ".ocamlinit" + let load_ocamlinit () = - if Sys.file_exists ".ocamlinit" then ignore(use_silently ".ocamlinit") + if Sys.file_exists !initfile_name then ignore(use_silently !initfile_name) (* The interactive loop *) @@ -311,7 +314,7 @@ (* Execute a script *) let run_script name = - Compile.init_path(); toplevel_env := Compile.initial_env(); Format.set_formatter_out_channel stderr; + load_ocamlinit (); use_silently name -- Ian T Zimmerman I came to the conclusion that what was wrong about the guillotine was that the condemned man had no chance at all, absolutely none. Albert Camus, _The Outsider_