diff -r -c findlib/Makefile findlib.modern/Makefile
*** findlib/Makefile	Tue Jan 11 07:36:41 2000
--- findlib.modern/Makefile	Wed Jan 26 12:48:38 2000
***************
*** 9,16 ****
  
  NAME = findlib
  
! OCAMLC = ocamlc
! OCAMLOPT = ocamlopt
  OCAMLDEP = ocamldep
  OCAMLLEX = ocamllex
  
--- 9,16 ----
  
  NAME = findlib
  
! OCAMLC = ocamlc -modern
! OCAMLOPT = ocamlopt -modern
  OCAMLDEP = ocamldep
  OCAMLLEX = ocamllex
  
Only in findlib.modern: Makefile.config
Only in findlib.modern/config: err.out
Only in findlib.modern/config: makehelper
Only in findlib.modern/config: simple_threads.cmi
Only in findlib.modern/config: simple_threads.cmo
Only in findlib.modern: depend
Only in findlib.modern: findlib.a
Only in findlib.modern: findlib.cma
Only in findlib.modern: findlib.cmi
Only in findlib.modern: findlib.cmo
Only in findlib.modern: findlib.cmx
Only in findlib.modern: findlib.cmxa
Only in findlib.modern: findlib.ml
Only in findlib.modern: findlib.o
Only in findlib.modern: findlib_config.cmi
Only in findlib.modern: findlib_config.cmo
Only in findlib.modern: findlib_config.cmx
Only in findlib.modern: findlib_config.ml
Only in findlib.modern: findlib_config.o
Only in findlib.modern: findlib_mt.a
Only in findlib.modern: findlib_mt.cma
Only in findlib.modern: findlib_mt.cmxa
Only in findlib.modern: findlib_top.cma
Only in findlib.modern: frontend.cmi
Only in findlib.modern: frontend.cmo
Only in findlib.modern: frontend.cmx
diff -r -c findlib/frontend.ml findlib.modern/frontend.ml
*** findlib/frontend.ml	Tue Jan 11 07:48:04 2000
--- findlib.modern/frontend.ml	Wed Jan 26 15:03:27 2000
***************
*** 34,40 ****
  	'%' ->
  	  if j+1<l then begin
  	    let c = s.[j+1] in
! 	    Const(String.sub s i (j-i)) :: Percent c :: preprocess (j+2) (j+2)
  	  end
  	  else failwith "bad format string"
        |	_ ->
--- 34,40 ----
  	'%' ->
  	  if j+1<l then begin
  	    let c = s.[j+1] in
! 	    Const(String.sub pos: i len: (j-i) s) :: Percent c :: preprocess (j+2) (j+2)
  	  end
  	  else failwith "bad format string"
        |	_ ->
***************
*** 42,48 ****
      end
      else
        if i<j then
! 	[Const(String.sub s i (j-i))]
        else
  	[]
    in
--- 42,48 ----
      end
      else
        if i<j then
! 	[Const(String.sub pos: i len: (j-i) s)]
        else
  	[]
    in
***************
*** 54,64 ****
  	subst (prefix ^ s) l'
      | Percent c :: l' ->
  	let replacements =
! 	  try List.assoc c spec 
  	  with Not_found -> failwith "bad format string" in
  	List.flatten
  	  (List.map
! 	     (fun replacement ->
  	       subst (prefix ^ replacement) l')
  	     replacements)
    in
--- 54,64 ----
  	subst (prefix ^ s) l'
      | Percent c :: l' ->
  	let replacements =
! 	  try List.assoc key: c spec 
  	  with Not_found -> failwith "bad format string" in
  	List.flatten
  	  (List.map
! 	     fun: (fun replacement ->
  	       subst (prefix ^ replacement) l')
  	     replacements)
    in
***************
*** 70,76 ****
  let rec remove_dups l =
    match l with
      x :: l' ->
!       if List.mem x l' then remove_dups l' else x::remove_dups l'
    | [] -> []
  ;;
  
--- 70,76 ----
  let rec remove_dups l =
    match l with
      x :: l' ->
!       if List.mem key: x l' then remove_dups l' else x::remove_dups l'
    | [] -> []
  ;;
  
***************
*** 83,89 ****
  let use_package prefix pkgnames =
    let pdirs =
      List.map
!       (fun pname ->
          try
            "-I " ^ package_directory pname
          with
--- 83,89 ----
  let use_package prefix pkgnames =
    let pdirs =
      List.map
!       fun: (fun pname ->
          try
            "-I " ^ package_directory pname
          with
***************
*** 91,97 ****
        pkgnames
    in
  
!   print_endline (prefix ^ String.concat " " pdirs)
  ;;
  
  
--- 91,97 ----
        pkgnames
    in
  
!   print_endline (prefix ^ String.concat sep: " " pdirs)
  ;;
  
  
***************
*** 113,119 ****
  
    List.flatten
      (List.map
!        (fun pkg ->
  	 let dir =
  	   try package_directory pkg 
  	   with Not_found -> failwith ("package '" ^ pkg ^ "' not found")
--- 113,119 ----
  
    List.flatten
      (List.map
!        fun: (fun pkg ->
  	 let dir =
  	   try package_directory pkg 
  	   with Not_found -> failwith ("package '" ^ pkg ^ "' not found")
***************
*** 126,139 ****
  	     'a',  Split.in_words 
  	             (try package_property predicates pkg "archive"
  		      with Not_found -> "");
! 	     'A',  [String.concat " "
  		       (Split.in_words 
  		          (try package_property predicates pkg "archive"
  			   with Not_found -> ""))];
  	     'o',  Split.in_words_ws
  	             (try package_property predicates pkg "linkopts"
  		      with Not_found -> "");
! 	     'O',  [String.concat " "
  		       (Split.in_words_ws 
  		          (try package_property predicates pkg "linkopts"
  			   with Not_found -> ""))];
--- 126,139 ----
  	     'a',  Split.in_words 
  	             (try package_property predicates pkg "archive"
  		      with Not_found -> "");
! 	     'A',  [String.concat sep: " "
  		       (Split.in_words 
  		          (try package_property predicates pkg "archive"
  			   with Not_found -> ""))];
  	     'o',  Split.in_words_ws
  	             (try package_property predicates pkg "linkopts"
  		      with Not_found -> "");
! 	     'O',  [String.concat sep: " "
  		       (Split.in_words_ws 
  		          (try package_property predicates pkg "linkopts"
  			   with Not_found -> ""))];
***************
*** 178,183 ****
--- 178,184 ----
  
  
    Arg.parse
+     keywords:
      [ "-predicates", Arg.String append_predicate,
                    "      specifies comma-separated list of assumed predicates";
        "-format", Arg.String (fun s -> format := s),
***************
*** 203,209 ****
        "-o-format", Arg.Unit (fun () -> format := o_format),
                  "        prints link options for ocamlc";
      ] 
!     (fun p -> packages := !packages @ [p])
  "usage: ocamlfind query [ -predicates <p>  | -format <f> |
                           -long-format     | -i-format   |
                           -l-format        | -a-format   |
--- 204,211 ----
        "-o-format", Arg.Unit (fun () -> format := o_format),
                  "        prints link options for ocamlc";
      ] 
!     others: (fun p -> packages := !packages @ [p])
!     errmsg:
  "usage: ocamlfind query [ -predicates <p>  | -format <f> |
                           -long-format     | -i-format   |
                           -l-format        | -a-format   |
***************
*** 213,219 ****
  
      (* check packages: *)
      List.iter
!       (fun pkg ->
  	try
  	  let _ = package_directory pkg in
  	  ()
--- 215,221 ----
  
      (* check packages: *)
      List.iter
!     fun: (fun pkg ->
  	try
  	  let _ = package_directory pkg in
  	  ()
***************
*** 254,263 ****
  	  let dirs = !Metacache.ocamlpath in
  	  let subdirs = 
  	    List.flatten
! 	      (List.map list_directory dirs) in
  	  (* The 'subdirs' are possible package names *)
  	  List.iter
! 	    (fun d ->
  	      try
  		(* Causes the package to be loaded into the cache: *)
  		let _ = Metacache.requires !predicates d in ()
--- 256,265 ----
  	  let dirs = !Metacache.ocamlpath in
  	  let subdirs = 
  	    List.flatten
! 	      (List.map fun: list_directory dirs) in
  	  (* The 'subdirs' are possible package names *)
  	  List.iter
! 	    fun: (fun d ->
  	      try
  		(* Causes the package to be loaded into the cache: *)
  		let _ = Metacache.requires !predicates d in ()
***************
*** 279,285 ****
      let answers = expand !predicates eff_packages !format in
  
       print_string !prefix;
!      print_string (String.concat !separator answers);
       print_string !suffix;
  ;;
  
--- 281,287 ----
      let answers = expand !predicates eff_packages !format in
  
       print_string !prefix;
!      print_string (String.concat sep: !separator answers);
       print_string !suffix;
  ;;
  
***************
*** 321,326 ****
--- 323,329 ----
      Arg.String (fun s -> dontlink := !dontlink @ (Split.in_words s)) in
  
    Arg.parse
+     keywords:
      (List.flatten
      [ [
        "-package", add_pkg,
***************
*** 375,380 ****
--- 378,385 ----
                     " <s>  Suffix for interface file (default: .mli)";
        "-intf_suffix", add_spec "-intf_suffix",
                     " <s>  same as -intf-suffix";
+       "-modern", add_switch "-modern",
+               "           Use strict label syntax";
        "-linkall", add_switch "-linkall",
                 "          Link all modules, even unused ones";
        ]	;
***************
*** 446,452 ****
--- 451,459 ----
  	 " <file>          Treat <file> as a file name (even if it starts with `-')";
         ]	
      ])
+     others:
      (fun s -> pass_files := !pass_files @ [ Pass s])
+     errmsg:
      ("usage: ocamlfind " ^ which ^ " [options] file ...");
  
    begin match which with
***************
*** 457,463 ****
    | _            -> failwith "unsupported backend"
    end;
  
!   if List.mem "-thread" !switches then begin
      predicates := "mt" :: !predicates;
      (* check type of threads: posix or bytecode *)
      try
--- 464,470 ----
    | _            -> failwith "unsupported backend"
    end;
  
!   if List.mem key: "-thread" !switches then begin
      predicates := "mt" :: !predicates;
      (* check type of threads: posix or bytecode *)
      try
***************
*** 468,485 ****
        Not_found -> ()
    end;
  
!   if List.mem "-p" !switches then
      predicates := "gprof" :: !predicates;
  
!   let verbose = List.mem "-verbose" !switches in
  
    if verbose then 
      print_string ("Effective set of predicates: " ^ 
! 		  String.concat "," !predicates ^ "\n");
  
    (* check packages: *)
    List.iter
!     (fun pkg ->
        try
  	let _ = package_directory pkg in
  	()
--- 475,492 ----
        Not_found -> ()
    end;
  
!   if List.mem key: "-p" !switches then
      predicates := "gprof" :: !predicates;
  
!   let verbose = List.mem key: "-verbose" !switches in
  
    if verbose then 
      print_string ("Effective set of predicates: " ^ 
! 		  String.concat sep: "," !predicates ^ "\n");
  
    (* check packages: *)
    List.iter
!     fun: (fun pkg ->
        try
  	let _ = package_directory pkg in
  	()
***************
*** 488,494 ****
  	  failwith ("package '" ^ pkg ^ "' not found"))
      !packages;
    List.iter
!     (fun pkg ->
        try
  	let _ = package_directory pkg in
  	()
--- 495,501 ----
  	  failwith ("package '" ^ pkg ^ "' not found"))
      !packages;
    List.iter
!     fun: (fun pkg ->
        try
  	let _ = package_directory pkg in
  	()
***************
*** 507,528 ****
    let eff_link =
      List.flatten
        (List.map
! 	 (fun pkg -> if List.mem pkg !dontlink then [] else [pkg])
  	 eff_packages) in
  
  
    let eff_packages_dl =
!     remove_dups (List.map package_directory eff_packages) in
  
    let eff_link_dl =
!     remove_dups (List.map package_directory eff_link) in
  
    let init_file_needed =
!     List.mem "toploop" !predicates & List.mem "findlib" eff_link in
  
    let init_file_name =
      if init_file_needed then
!       Filename.temp_file "findlib_init" ".ml"
      else
        ""
    in
--- 514,535 ----
    let eff_link =
      List.flatten
        (List.map
! 	 fun: (fun pkg -> if List.mem key: pkg !dontlink then [] else [pkg])
  	 eff_packages) in
  
  
    let eff_packages_dl =
!     remove_dups (List.map fun: package_directory eff_packages) in
  
    let eff_link_dl =
!     remove_dups (List.map fun: package_directory eff_link) in
  
    let init_file_needed =
!     List.mem key: "toploop" !predicates & List.mem key: "findlib" eff_link in
  
    let init_file_name =
      if init_file_needed then
!       Filename.temp_file prefix: "findlib_init" suffix: ".ml"
      else
        ""
    in
***************
*** 530,551 ****
    if init_file_needed then begin
      (* Generate initializer for "findlib_top.cma" *)
      let f = open_out_gen 
! 	      [Open_wronly; Open_trunc; Open_text]
! 	      0o777
  	      init_file_name in
      try
!       output_string f 
  	("Topfind.don't_load [" ^ 
! 	 String.concat ";"
  	   (List.map
! 	      (fun pkg -> "\"" ^ String.escaped pkg ^ "\"")
  	      eff_link) ^
  	 "];;\n");
!       output_string f
  	("Topfind.predicates := [" ^ 
! 	 String.concat ";"
  	   (List.map
! 	      (fun pred -> "\"" ^ String.escaped pred ^ "\"")
  	      !predicates) ^
  	 "];;\n");
        close_out f
--- 537,558 ----
    if init_file_needed then begin
      (* Generate initializer for "findlib_top.cma" *)
      let f = open_out_gen 
! 	      mode: [Open_wronly; Open_trunc; Open_text]
! 	      perm: 0o777
  	      init_file_name in
      try
!       output_string to: f 
  	("Topfind.don't_load [" ^ 
! 	 String.concat sep: ";"
  	   (List.map
! 	      fun: (fun pkg -> "\"" ^ String.escaped pkg ^ "\"")
  	      eff_link) ^
  	 "];;\n");
!       output_string to: f
  	("Topfind.predicates := [" ^ 
! 	 String.concat sep: ";"
  	   (List.map
! 	      fun: (fun pred -> "\"" ^ String.escaped pred ^ "\"")
  	      !predicates) ^
  	 "];;\n");
        close_out f
***************
*** 568,574 ****
    let i_options =
      List.flatten
        (List.map
! 	 (fun pkgdir ->
  	   [ "-I"; pkgdir;
  	     "-ccopt"; "-I" ^ pkgdir; ])
  	 eff_packages_dl) in
--- 575,581 ----
    let i_options =
      List.flatten
        (List.map
! 	 fun: (fun pkgdir ->
  	   [ "-I"; pkgdir;
  	     "-ccopt"; "-I" ^ pkgdir; ])
  	 eff_packages_dl) in
***************
*** 576,593 ****
    let l_options =
      List.flatten
        (List.map
! 	 (fun pkgdir ->
  	   [ "-ccopt"; "-L" ^ pkgdir; ])
  	 eff_link_dl) in
  
    let archives =
      List.flatten
        (List.map
! 	 (fun pkg -> 
  	   let al = try package_property !predicates pkg "archive"
  	            with Not_found -> "" in
  	   List.map 
! 	     (fun a -> Filename.concat (package_directory pkg) a) 
  	     (Split.in_words al)
  	   @
  	   (if init_file_needed & pkg = "findlib" then
--- 583,600 ----
    let l_options =
      List.flatten
        (List.map
! 	 fun: (fun pkgdir ->
  	   [ "-ccopt"; "-L" ^ pkgdir; ])
  	 eff_link_dl) in
  
    let archives =
      List.flatten
        (List.map
! 	 fun: (fun pkg -> 
  	   let al = try package_property !predicates pkg "archive"
  	            with Not_found -> "" in
  	   List.map 
! 	     fun: (fun a -> Filename.concat (package_directory pkg) a) 
  	     (Split.in_words al)
  	   @
  	   (if init_file_needed & pkg = "findlib" then
***************
*** 599,605 ****
    let linkopts =
      List.flatten
        (List.map
! 	 (fun pkg -> 
  	   let ol = try package_property !predicates pkg "linkopts"
  	            with Not_found -> "" in
  	   Split.in_words_ws ol)
--- 606,612 ----
    let linkopts =
      List.flatten
        (List.map
! 	 fun: (fun pkg -> 
  	   let ol = try package_property !predicates pkg "linkopts"
  	            with Not_found -> "" in
  	   Split.in_words_ws ol)
***************
*** 609,618 ****
    let pass_files' =
      List.flatten
        (List.map
! 	 (function
  	      Pass s ->
  		if s.[0] = '-' 
! 		then [ "-"; String.sub s 1 (String.length s - 1) ]
  		else [ s ]
  	    | Impl s ->
  		[ "-impl"; s ]
--- 616,625 ----
    let pass_files' =
      List.flatten
        (List.map
! 	 fun: (function
  	      Pass s ->
  		if s.[0] = '-' 
! 		then [ "-"; String.sub pos: 1 len: (String.length s - 1) s ]
  		else [ s ]
  	    | Impl s ->
  		[ "-impl"; s ]
***************
*** 632,651 ****
    in
  
    if verbose then
!     print_string ("+ " ^ which ^ " " ^ String.concat " " arguments ^ "\n");
  
    flush stdout;
    
    let pid =
      Unix.create_process 
!       which 
!       (Array.of_list (which :: arguments)) 
!       Unix.stdin
!       Unix.stdout
!       Unix.stderr
    in
  
!   let (_,status) = Unix.waitpid [] pid in
    begin
      match status with
        Unix.WEXITED 0 -> ()
--- 639,658 ----
    in
  
    if verbose then
!     print_string ("+ " ^ which ^ " " ^ String.concat sep: " " arguments ^ "\n");
  
    flush stdout;
    
    let pid =
      Unix.create_process 
!       name: which 
!       args: (Array.of_list (which :: arguments)) 
!       stdin: Unix.stdin
!       stdout: Unix.stdout
!       stderr: Unix.stderr
    in
  
!   let (_,status) = Unix.waitpid mode: [] pid in
    begin
      match status with
        Unix.WEXITED 0 -> ()
***************
*** 681,687 ****
         match c with
           '\''   -> "'\\''" ^ sh_protect s (k+1)
         | '\000' -> failwith "cannot pass null character"
!        | _      -> String.make 1 c ^ sh_protect s (k+1)
      else
        ""
    in
--- 688,694 ----
         match c with
           '\''   -> "'\\''" ^ sh_protect s (k+1)
         | '\000' -> failwith "cannot pass null character"
!        | _      -> String.make len: 1 c ^ sh_protect s (k+1)
      else
        ""
    in
***************
*** 740,746 ****
    try
      let m = select_mode() in
      let l = Array.length Sys.argv in
!     let rest = Array.sub Sys.argv 2 (l-2) in
      if rest = [| |] then raise Usage;
      match m with
        M_use      -> if rest.(0) = "-p" then begin
--- 747,753 ----
    try
      let m = select_mode() in
      let l = Array.length Sys.argv in
!     let rest = Array.sub pos: 2 len: (l-2) Sys.argv in
      if rest = [| |] then raise Usage;
      match m with
        M_use      -> if rest.(0) = "-p" then begin
Only in findlib.modern: frontend.ml~
Only in findlib.modern: frontend.o
Only in findlib.modern: meta.cmi
Only in findlib.modern: meta.cmo
Only in findlib.modern: meta.cmx
Only in findlib.modern: meta.ml
diff -r -c findlib/meta.mll findlib.modern/meta.mll
*** findlib/meta.mll	Mon Jun 21 04:26:25 1999
--- findlib.modern/meta.mll	Wed Jan 26 12:54:41 2000
***************
*** 34,40 ****
    | '"' [^ '"' '\\' ]* ( "\\\\" | "\\\"" [^ '"' '\\' ]* )* '"'
    {
      let s1 = Lexing.lexeme lexbuf in
!     let s2 = String.sub s1 1 (String.length s1 - 2) in
      let l2 = String.length s2 in
      let rec count i n =
        if i<l2 then
--- 34,40 ----
    | '"' [^ '"' '\\' ]* ( "\\\\" | "\\\"" [^ '"' '\\' ]* )* '"'
    {
      let s1 = Lexing.lexeme lexbuf in
!     let s2 = String.sub pos: 1 len: (String.length s1 - 2) s1 in
      let l2 = String.length s2 in
      let rec count i n =
        if i<l2 then
***************
*** 44,50 ****
        else
  	n
      in
!     let s3 = String.create (count 0 0) in
      let rec fill i n =
        if i<l2 then
  	match s2.[i] with
--- 44,50 ----
        else
  	n
      in
!     let s3 = String.create len: (count 0 0) in
      let rec fill i n =
        if i<l2 then
  	match s2.[i] with
Only in findlib.modern: meta.o
Only in findlib.modern: metacache.cmi
Only in findlib.modern: metacache.cmo
Only in findlib.modern: metacache.cmx
diff -r -c findlib/metacache.ml findlib.modern/metacache.ml
*** findlib/metacache.ml	Sun Jun 27 00:01:50 1999
--- findlib.modern/metacache.ml	Wed Jan 26 12:59:51 2000
***************
*** 70,79 ****
  		    match d.[0] with
  		      '&' -> Filename.concat
  			        Findlib_config.default_site_lib_loc
! 			        (String.sub d 1 (String.length d - 1))
                      | '^' -> Filename.concat
  			        Findlib_config.ocaml_stdlib
! 			        (String.sub d 1 (String.length d - 1))
  		    | _ -> d
  		in
  
--- 70,79 ----
  		    match d.[0] with
  		      '&' -> Filename.concat
  			        Findlib_config.default_site_lib_loc
! 			        (String.sub pos: 1 len: (String.length d - 1) d)
                      | '^' -> Filename.concat
  			        Findlib_config.ocaml_stdlib
! 			        (String.sub pos: 1 len: (String.length d - 1) d)
  		    | _ -> d
  		in
  
***************
*** 131,137 ****
    in
    let ancestors = Split.in_words r in
    List.iter
!     (fun p ->
        try
  	let _ = query p in
  	Metastore.let_le store p package
--- 131,137 ----
    in
    let ancestors = Split.in_words r in
    List.iter
!     fun: (fun p ->
        try
  	let _ = query p in
  	Metastore.let_le store p package
***************
*** 162,168 ****
    let rec enter_packages pkglist =
      match pkglist with
        pkg :: pkglist' ->
! 	if not(List.mem pkg !done_pkgs) then begin
  	  let pkg_ancestors = requires plist pkg in
  	  done_pkgs := pkg :: !done_pkgs;
            enter_packages pkg_ancestors
--- 162,168 ----
    let rec enter_packages pkglist =
      match pkglist with
        pkg :: pkglist' ->
! 	if not(List.mem key: pkg !done_pkgs) then begin
  	  let pkg_ancestors = requires plist pkg in
  	  done_pkgs := pkg :: !done_pkgs;
            enter_packages pkg_ancestors
Only in findlib.modern: metacache.o
Only in findlib.modern: metacache_mt.cmi
Only in findlib.modern: metacache_mt.cmo
Only in findlib.modern: metacache_mt.cmx
Only in findlib.modern: metacache_mt.o
Only in findlib.modern: metascanner.cmi
Only in findlib.modern: metascanner.cmo
Only in findlib.modern: metascanner.cmx
diff -r -c findlib/metascanner.ml findlib.modern/metascanner.ml
*** findlib/metascanner.ml	Mon Jun 21 04:26:26 1999
--- findlib.modern/metascanner.ml	Wed Jan 26 13:06:51 2000
***************
*** 34,40 ****
    let rec mk_set l =
      match l with
        x :: l' ->
! 	if List.mem x l' then mk_set l' else x :: (mk_set l')
      | [] ->
  	[]
    in
--- 34,40 ----
    let rec mk_set l =
      match l with
        x :: l' ->
! 	if List.mem key: x l' then mk_set l' else x :: (mk_set l')
      | [] ->
  	[]
    in
***************
*** 43,56 ****
      match stream with parser
        [< '(line, col, Name n); 
           props = parse_properties
! 	  ? ("Error in 'name = value' clause  in line " ^ 
  	     string_of_int line ^ " position " ^ string_of_int col);
  	 rest = parse_all 
! 	  ? ("Error in 'name = value' clause  in line " ^ 
  	     string_of_int line ^ " position " ^ string_of_int col)
         >]
  	-> let args, value = props in
! 	(n, (Sort.list ( <= ) (mk_set args), value)) :: rest
      | [< '(_,_,Eof) >]
  	-> []
      | [< '(line,col,_) >]
--- 43,56 ----
      match stream with parser
        [< '(line, col, Name n); 
           props = parse_properties
! 	  ?? ("Error in 'name = value' clause  in line " ^ 
  	     string_of_int line ^ " position " ^ string_of_int col);
  	 rest = parse_all 
! 	  ?? ("Error in 'name = value' clause  in line " ^ 
  	     string_of_int line ^ " position " ^ string_of_int col)
         >]
  	-> let args, value = props in
! 	(n, (Sort.list order: ( <= ) (mk_set args), value)) :: rest
      | [< '(_,_,Eof) >]
  	-> []
      | [< '(line,col,_) >]
***************
*** 62,80 ****
      match stream with parser
        [< '(line,col,LParen); 
  	 '(line1,col1,Name n)
! 	  ? ("After a '(' there must be an argument name in line " ^
  	    string_of_int line ^ " position " ^ string_of_int col);
  	 args = parse_arguments; 
  	 '(line2,col2,Equal)
! 	  ? ("'=' expected after '(arguments)' clause in line " ^
  	    string_of_int line ^ " position " ^ string_of_int col);
           '(line3,col3,String s) 
! 	 ? ("Expected string constant after '=' in line " ^
  	    string_of_int line2 ^ " position " ^ string_of_int col2)
        >]
  	-> n::args, s
      | [< '(line,col,Equal); '(_,_,String s) 
! 	 ? ("'=' must be followed by a string constant in line " ^
  	    string_of_int line ^ " position " ^ string_of_int col)
        >]
  	-> [], s
--- 62,80 ----
      match stream with parser
        [< '(line,col,LParen); 
  	 '(line1,col1,Name n)
! 	  ?? ("After a '(' there must be an argument name in line " ^
  	    string_of_int line ^ " position " ^ string_of_int col);
  	 args = parse_arguments; 
  	 '(line2,col2,Equal)
! 	  ?? ("'=' expected after '(arguments)' clause in line " ^
  	    string_of_int line ^ " position " ^ string_of_int col);
           '(line3,col3,String s) 
! 	 ?? ("Expected string constant after '=' in line " ^
  	    string_of_int line2 ^ " position " ^ string_of_int col2)
        >]
  	-> n::args, s
      | [< '(line,col,Equal); '(_,_,String s) 
! 	 ?? ("'=' must be followed by a string constant in line " ^
  	    string_of_int line ^ " position " ^ string_of_int col)
        >]
  	-> [], s
***************
*** 87,93 ****
      match stream with parser
        [< '(line,col,Comma); 
  	 '(line1,col1,Name n)
! 	 ? ("Expected argument name after ',' in line " ^
  	    string_of_int line ^ " position " ^ string_of_int col);
  	 args = parse_arguments 
        >]
--- 87,93 ----
      match stream with parser
        [< '(line,col,Comma); 
  	 '(line1,col1,Name n)
! 	 ?? ("Expected argument name after ',' in line " ^
  	    string_of_int line ^ " position " ^ string_of_int col);
  	 args = parse_arguments 
        >]
***************
*** 106,116 ****
        [] -> ()
      | (n, (args, value)) :: l' ->
  	List.iter
! 	  (fun (n', (args', value')) ->
  	    if n=n' & args=args' then
  	      raise(Stream.Error ("Double definition of '" ^ n ^ "'" ^
  				  (if args = [] then "" else
! 				  "(" ^  String.concat "," args ^ ")"))))
  	  l';
  	check l'
    in
--- 106,116 ----
        [] -> ()
      | (n, (args, value)) :: l' ->
  	List.iter
! 	  fun: (fun (n', (args', value')) ->
  	    if n=n' & args=args' then
  	      raise(Stream.Error ("Double definition of '" ^ n ^ "'" ^
  				  (if args = [] then "" else
! 				  "(" ^  String.concat sep: "," args ^ ")"))))
  	  l';
  	check l'
    in
***************
*** 131,137 ****
  	  raise Not_found
      | (name', (predicates, value)) :: l' ->
  	if name = name' & 
! 	   (List.for_all (fun p -> List.mem p predicate_list) predicates) &
  	   (List.length predicates > best_n) then
  	  search (List.length predicates) value l'
  	else
--- 131,137 ----
  	  raise Not_found
      | (name', (predicates, value)) :: l' ->
  	if name = name' & 
! 	   (List.for_all pred: (fun p -> List.mem key: p predicate_list) predicates) &
  	   (List.length predicates > best_n) then
  	  search (List.length predicates) value l'
  	else
Only in findlib.modern: metascanner.o
Only in findlib.modern: metatoken.cmi
Only in findlib.modern: metatoken.cmo
Only in findlib.modern: metatoken.cmx
Only in findlib.modern: metatoken.o
Only in findlib.modern/mt: findlib.cmi
Only in findlib.modern/mt: findlib.cmo
Only in findlib.modern/mt: findlib.cmx
Only in findlib.modern/mt: findlib.mli
Only in findlib.modern/mt: findlib.mml
Only in findlib.modern/mt: findlib.o
Only in findlib.modern: ocamlfind
Only in findlib.modern: ocamlfind_opt
Only in findlib.modern/site-lib/dbm: META
Only in findlib.modern/site-lib/dynlink: META
Only in findlib.modern/site-lib/graphics: META
Only in findlib.modern/site-lib/num: META
Only in findlib.modern/site-lib/stdlib: META
Only in findlib.modern/site-lib/str: META
Only in findlib.modern/site-lib/threads: META
Only in findlib.modern/site-lib/unix: META
Only in findlib.modern: split.cmi
Only in findlib.modern: split.cmo
Only in findlib.modern: split.cmx
diff -r -c findlib/split.ml findlib.modern/split.ml
*** findlib/split.ml	Mon Jun 21 04:26:26 1999
--- findlib.modern/split.ml	Wed Jan 26 12:54:28 2000
***************
*** 11,22 ****
      if j < l then
        match s.[j] with
  	(' '|'\t'|'\n'|'\r'|',') ->
! 	  if i<j then (String.sub s i (j-i)) :: (split (j+1) (j+1))
  		 else split (j+1) (j+1)
        |	_ ->
  	  split i (j+1)
      else
!       if i<j then [ String.sub s i (j-i) ] else []
    in
    split 0 0
  ;;
--- 11,22 ----
      if j < l then
        match s.[j] with
  	(' '|'\t'|'\n'|'\r'|',') ->
! 	  if i<j then (String.sub pos: i len: (j-i) s) :: (split (j+1) (j+1))
  		 else split (j+1) (j+1)
        |	_ ->
  	  split i (j+1)
      else
!       if i<j then [ String.sub pos: i len: (j-i) s ] else []
    in
    split 0 0
  ;;
***************
*** 29,40 ****
      if j < l then
        match s.[j] with
  	(' '|'\t'|'\n'|'\r') ->
! 	  if i<j then (String.sub s i (j-i)) :: (split (j+1) (j+1))
  		 else split (j+1) (j+1)
        |	_ ->
  	  split i (j+1)
      else
!       if i<j then [ String.sub s i (j-i) ] else []
    in
    split 0 0
  ;;
--- 29,40 ----
      if j < l then
        match s.[j] with
  	(' '|'\t'|'\n'|'\r') ->
! 	  if i<j then (String.sub pos: i len: (j-i) s) :: (split (j+1) (j+1))
  		 else split (j+1) (j+1)
        |	_ ->
  	  split i (j+1)
      else
!       if i<j then [ String.sub pos: i len: (j-i) s ] else []
    in
    split 0 0
  ;;
***************
*** 57,63 ****
        let c = str.[k] in
        if c = path_separator then begin
          if k - j > 0 then
! 	  String.sub str j (k-j) :: split_up (k+1) (k+1)
          else
  	  split_up (k+1) (k+1)
        end
--- 57,63 ----
        let c = str.[k] in
        if c = path_separator then begin
          if k - j > 0 then
! 	  String.sub pos: j len: (k-j) str :: split_up (k+1) (k+1)
          else
  	  split_up (k+1) (k+1)
        end
***************
*** 66,72 ****
      end
      else
        if k - j > 0 then
!         [ String.sub str j (k-j) ]
        else
  	[]
    in
--- 66,72 ----
      end
      else
        if k - j > 0 then
!         [ String.sub pos: j len: (k-j) str ]
        else
  	[]
    in
Only in findlib.modern: split.o
Only in findlib.modern: topfind.cmi
Only in findlib.modern: topfind.cmo
diff -r -c findlib/topfind.ml findlib.modern/topfind.ml
*** findlib/topfind.ml	Sun Jul 11 04:51:27 1999
--- findlib.modern/topfind.ml	Wed Jan 26 13:04:34 2000
***************
*** 10,16 ****
  
  
  let add_dir d =
!   if not (List.mem d !directories) then begin
      Topdirs.dir_directory d;
      directories := d :: !directories
    end
--- 10,16 ----
  
  
  let add_dir d =
!   if not (List.mem key: d !directories) then begin
      Topdirs.dir_directory d;
      directories := d :: !directories
    end
***************
*** 19,26 ****
  
  let load pkglist =
    List.iter
!     (fun pkg ->
!       if not (List.mem pkg !loaded) then begin
          (* Determine the package directory: *)
  	let d = 
  	  try Findlib.package_directory pkg 
--- 19,26 ----
  
  let load pkglist =
    List.iter
!     fun: (fun pkg ->
!       if not (List.mem key: pkg !loaded) then begin
          (* Determine the package directory: *)
  	let d = 
  	  try Findlib.package_directory pkg 
***************
*** 30,36 ****
  	in
  	add_dir d;
          (* Leave pkg out if mentioned in !forbidden *)
! 	if not (List.mem pkg !forbidden) then begin
  	  (* Determine the 'archive' property: *)
  	  let archive =
  	    try Findlib.package_property !predicates pkg "archive"
--- 30,36 ----
  	in
  	add_dir d;
          (* Leave pkg out if mentioned in !forbidden *)
! 	if not (List.mem key: pkg !forbidden) then begin
  	  (* Determine the 'archive' property: *)
  	  let archive =
  	    try Findlib.package_property !predicates pkg "archive"
***************
*** 40,46 ****
  	  (* Split the 'archive' property and load the files: *)
  	  let archives = Split.in_words archive in
  	  List.iter
! 	    (fun a ->
  	      (* prerr_endline ("Loading " ^ (Filename.concat d a)); *)
  	      Topdirs.dir_load 
  		(Filename.concat d a))
--- 40,46 ----
  	  (* Split the 'archive' property and load the files: *)
  	  let archives = Split.in_words archive in
  	  List.iter
! 	    fun: (fun a ->
  	      (* prerr_endline ("Loading " ^ (Filename.concat d a)); *)
  	      Topdirs.dir_load 
  		(Filename.concat d a))
***************
*** 56,62 ****
  let load_deeply pkglist =
    (* Check if packages exist: *)
    List.iter
!     (fun pkg ->
        try
  	let _ = Findlib.package_directory pkg in ()
        with
--- 56,62 ----
  let load_deeply pkglist =
    (* Check if packages exist: *)
    List.iter
!     fun: (fun pkg ->
        try
  	let _ = Findlib.package_directory pkg in ()
        with
***************
*** 74,80 ****
  let rec remove_dups l =
    match l with
      x :: l' ->
!       if List.mem x l' then remove_dups l' else x::remove_dups l'
    | [] -> []
  ;;
  
--- 74,80 ----
  let rec remove_dups l =
    match l with
      x :: l' ->
!       if List.mem key: x l' then remove_dups l' else x::remove_dups l'
    | [] -> []
  ;;
  
***************
*** 82,88 ****
  let don't_load pkglist =
    forbidden := remove_dups (pkglist @ !forbidden);
    List.iter
!     (fun pkg ->
         try
  	let d = Findlib.package_directory pkg in
  	()
--- 82,88 ----
  let don't_load pkglist =
    forbidden := remove_dups (pkglist @ !forbidden);
    List.iter
!     fun: (fun pkg ->
         try
  	let d = Findlib.package_directory pkg in
  	()
***************
*** 96,102 ****
  let don't_load_deeply pkglist =
    (* Check if packages exist: *)
    List.iter
!     (fun pkg ->
        try
  	let _ = Findlib.package_directory pkg in ()
        with
--- 96,102 ----
  let don't_load_deeply pkglist =
    (* Check if packages exist: *)
    List.iter
!     fun: (fun pkg ->
        try
  	let _ = Findlib.package_directory pkg in ()
        with
***************
*** 120,127 ****
  
  Hashtbl.add
      Toploop.directive_table
!     "require"
!     (Toploop.Directive_string
         (fun s -> 
  	 try
  	   load_deeply (Split.in_words s)
--- 120,127 ----
  
  Hashtbl.add
      Toploop.directive_table
!     key: "require"
!     data: (Toploop.Directive_string
         (fun s -> 
  	 try
  	   load_deeply (Split.in_words s)
Only in findlib.modern: topo.cmi
Only in findlib.modern: topo.cmo
Only in findlib.modern: topo.cmx
diff -r -c findlib/topo.ml findlib.modern/topo.ml
*** findlib/topo.ml	Mon Jun 21 04:26:26 1999
--- findlib.modern/topo.ml	Wed Jan 26 13:03:53 2000
***************
*** 85,91 ****
      let add ordering x =
        (* Is there already a node with the same key? *)
        let k = H.id x in
!       if List.exists (fun y -> H.id y.content = k) ordering.cnt then
  	raise Inconsistent_ordering;
  
        (* Ok, add the node to the list *)
--- 85,91 ----
      let add ordering x =
        (* Is there already a node with the same key? *)
        let k = H.id x in
!       if List.exists pred: (fun y -> H.id y.content = k) ordering.cnt then
  	raise Inconsistent_ordering;
  
        (* Ok, add the node to the list *)
***************
*** 122,128 ****
        let x = find_node ordering kx in
        ordering.cnt <- delete_all (fun a -> a == x) ordering.cnt;
        List.iter
! 	(fun x ->
  	  x.smaller <- delete_all (fun a -> a == x) x.smaller;
  	  x.bigger  <- delete_all (fun a -> a == x) x.bigger)
  	ordering.cnt
--- 122,128 ----
        let x = find_node ordering kx in
        ordering.cnt <- delete_all (fun a -> a == x) ordering.cnt;
        List.iter
! 	fun: (fun x ->
  	  x.smaller <- delete_all (fun a -> a == x) x.smaller;
  	  x.bigger  <- delete_all (fun a -> a == x) x.bigger)
  	ordering.cnt
***************
*** 139,145 ****
  	if x1 == y then
  	  true
  	else
! 	  List.exists search x1.bigger
  
        in
        search x
--- 139,145 ----
  	if x1 == y then
  	  true
  	else
! 	  List.exists pred: search x1.bigger
  
        in
        search x
***************
*** 152,158 ****
        let y = find_node ordering ky in
  
        (* If already done just return (this is an idempotent function) *)
!       if not (List.memq x y.smaller) then begin
  
          (* let x <= y. This is only allowed if not (y <= x) *)
        	if le_than ordering ky kx then
--- 152,158 ----
        let y = find_node ordering ky in
  
        (* If already done just return (this is an idempotent function) *)
!       if not (List.memq key: x y.smaller) then begin
  
          (* let x <= y. This is only allowed if not (y <= x) *)
        	if le_than ordering ky kx then
***************
*** 213,219 ****
        ordering.lock <- true;
  
        (* clear all marks *)
!       List.iter (fun nx -> nx.mark <- false) ordering.cnt;
  
        (* Catch exceptions *)
  
--- 213,219 ----
        ordering.lock <- true;
  
        (* clear all marks *)
!       List.iter fun: (fun nx -> nx.mark <- false) ordering.cnt;
  
        (* Catch exceptions *)
  
***************
*** 280,293 ****
        ordering.lock <- true;
  
        (* clear all marks *)
!       List.iter (fun nx -> nx.mark <- false) ordering.cnt;
  
        (* Catch exceptions *)
  
        try
  
  	List.iter
! 	  (fun start ->
  	    let _ = run_up (find_node ordering start) in ())
  	  startpoints;
        
--- 280,293 ----
        ordering.lock <- true;
  
        (* clear all marks *)
!       List.iter fun: (fun nx -> nx.mark <- false) ordering.cnt;
  
        (* Catch exceptions *)
  
        try
  
  	List.iter
! 	  fun: (fun start ->
  	    let _ = run_up (find_node ordering start) in ())
  	  startpoints;
        
Only in findlib.modern: topo.o
