You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1177 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello,
For aesthetic reasons (and being german) I prefer to capitalise
filenames, i.e., Foo.ml for the module Foo. In particular, filenames
like charInfo.ml and dVI.ml look extremely ugly to me. Is there any
reason why OCaml does not allow this?
In the patch below (relative to 3.04) I changed OCaml, when looking
for the module Foo, to first trying the file Foo.ml and, if
unsuccessful, to resort to foo.ml. If have used these modifications
for about a year without encountering any problems (w.r.t. compatibility
or otherwise).
Please, consider incorporating these changes in the next version.
diff -urd ocaml-3.04/asmcomp/compilenv.ml ocaml-3.04-build/asmcomp/compilenv.ml
--- ocaml-3.04/asmcomp/compilenv.ml Fri Apr 21 10:10:30 2000
+++ ocaml-3.04-build/asmcomp/compilenv.ml Thu Dec 20 19:51:41 2001
@@ -109,7 +109,7 @@
let (approx, crc) =
try
let filename =
find_in_path !load_path (String.uncapitalize modname ^ ".cmx") in
find_in_path_uncapitalized !load_path (modname ^ ".cmx") in
let (ui, crc) = read_unit_info filename in
if ui.ui_name <> modname then
raise(Error(Illegal_renaming(ui.ui_name, filename)));
let remove_file filename =
try
Sys.remove filename
diff -urd ocaml-3.04/utils/misc.mli ocaml-3.04-build/utils/misc.mli
--- ocaml-3.04/utils/misc.mli Thu Dec 28 06:02:43 2000
+++ ocaml-3.04-build/utils/misc.mli Thu Dec 20 19:51:41 2001
@@ -37,6 +37,9 @@
val find_in_path: string list -> string -> string
(* Search a file in a list of directories. *)
+val find_in_path_uncapitalized: string list -> string -> string
(* Search a file in a list of directories. If it isn't found the
uncapitalized filename is tried. *)
val remove_file: string -> unit
(* Delete the given file if it exists. Never raise an error. *)
val expand_directory: string -> string -> string
The text was updated successfully, but these errors were encountered:
For aesthetic reasons (and being german) I prefer to capitalise
filenames, i.e., Foo.ml for the module Foo. In particular, filenames
like charInfo.ml and dVI.ml look extremely ugly to me. Is there any
reason why OCaml does not allow this?
No deep reasons, just historical baggage. I like your proposal to
support both Modulename.ml and modulename.ml, and will incorporate it
in the working sources if there's no opposition from other members of
the Caml team.
Original bug ID: 1177
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello,
For aesthetic reasons (and being german) I prefer to capitalise
filenames, i.e., Foo.ml for the module Foo. In particular, filenames
like charInfo.ml and dVI.ml look extremely ugly to me. Is there any
reason why OCaml does not allow this?
In the patch below (relative to 3.04) I changed OCaml, when looking
for the module Foo, to first trying the file Foo.ml and, if
unsuccessful, to resort to foo.ml. If have used these modifications
for about a year without encountering any problems (w.r.t. compatibility
or otherwise).
Please, consider incorporating these changes in the next version.
Achim
Achim Blumensath \O/ ___/\ |
Mathematische Grundlagen der Informatik =o= \ /\ |
www-mgi.informatik.rwth-aachen.de/~blume /"\ o----|
___________________________________________________________________|
diff -urd ocaml-3.04/asmcomp/compilenv.ml ocaml-3.04-build/asmcomp/compilenv.ml
--- ocaml-3.04/asmcomp/compilenv.ml Fri Apr 21 10:10:30 2000
+++ ocaml-3.04-build/asmcomp/compilenv.ml Thu Dec 20 19:51:41 2001
@@ -109,7 +109,7 @@
let (approx, crc) =
try
let filename =
diff -urd ocaml-3.04/debugger/source.ml ocaml-3.04-build/debugger/source.ml
--- ocaml-3.04/debugger/source.ml Thu Aug 10 11:58:07 2000
+++ ocaml-3.04-build/debugger/source.ml Thu Dec 20 19:51:41 2001
@@ -21,7 +21,7 @@
(*** Conversion function. ***)
let source_of_module mdle =
(*** Buffer cache ***)
diff -urd ocaml-3.04/tools/ocamldep.ml ocaml-3.04-build/tools/ocamldep.ml
--- ocaml-3.04/tools/ocamldep.ml Tue Sep 25 11:54:14 2001
+++ ocaml-3.04-build/tools/ocamldep.ml Thu Dec 20 19:51:41 2001
@@ -278,9 +278,8 @@
let native_only = ref false
let find_dependency modname (byt_deps, opt_deps) =
try
let basename = Filename.chop_suffix filename ".mli" in
((basename ^ ".cmi") :: byt_deps,
(if Sys.file_exists (basename ^ ".ml")
@@ -288,7 +287,7 @@
else basename ^ ".cmi") :: opt_deps)
with Not_found ->
try
let basename = Filename.chop_suffix filename ".ml" in
((basename ^ (if !native_only then ".cmx" else ".cmo")) :: byt_deps,
(basename ^ ".cmx") :: opt_deps)
diff -urd ocaml-3.04/typing/env.ml ocaml-3.04-build/typing/env.ml
--- ocaml-3.04/typing/env.ml Sat Sep 29 00:55:27 2001
+++ ocaml-3.04-build/typing/env.ml Thu Dec 20 19:51:41 2001
@@ -147,7 +147,7 @@
Hashtbl.find persistent_structures name
with Not_found ->
read_pers_struct name
let reset_cache() =
Hashtbl.clear persistent_structures
diff -urd ocaml-3.04/utils/misc.ml ocaml-3.04-build/utils/misc.ml
--- ocaml-3.04/utils/misc.ml Thu Dec 28 14:07:42 2000
+++ ocaml-3.04-build/utils/misc.ml Thu Dec 20 19:51:41 2001
@@ -71,6 +71,12 @@
in try_dir path
end
+let find_in_path_uncapitalized path name =
let remove_file filename =
try
Sys.remove filename
diff -urd ocaml-3.04/utils/misc.mli ocaml-3.04-build/utils/misc.mli
--- ocaml-3.04/utils/misc.mli Thu Dec 28 06:02:43 2000
+++ ocaml-3.04-build/utils/misc.mli Thu Dec 20 19:51:41 2001
@@ -37,6 +37,9 @@
val find_in_path: string list -> string -> string
(* Search a file in a list of directories. *)
+val find_in_path_uncapitalized: string list -> string -> string
val remove_file: string -> unit
(* Delete the given file if it exists. Never raise an error. *)
val expand_directory: string -> string -> string
The text was updated successfully, but these errors were encountered: