Commits

Anonymous committed 773b5a5 Draft

string_map for ocaml<4

Comments (0)

Files changed (3)

       0 = Reb_sys.run ~show:false
         [| "ocamlfind" ; "query" ; name |]
   end
+
+
+let string_map f s =
+  let s = String.copy s in
+  let imax = String.length s - 1 in
+  let () =
+    for i = 0 to imax
+    do
+      s.[i] <- f s.[i]
+    done
+  in
+    s
       if fn = "" then ident_of_fn "Rebpkg" else
       if not (is_alpha fn.[0]) then ident_of_fn ("Rebpkg_" ^ fn) else
       let fn = String.capitalize fn in
-      String.map
+      string_map
         (fun c ->
            match c with
            [ c when is_alpha c -> c

src/post_template.ml

     ; assure_dir buildconf_work_src
     )
 
-  let string_map f s =
-    let s = String.copy s in
-    let imax = String.length s - 1 in
-    let () =
-      for i = 0 to imax
-      do
-        s.[i] <- f s.[i]
-      done
-    in
-      s
-
   let work_dir_of_pkg_name n =
     string_map
       (fun c ->