diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/Makefile | 6 | ||||
-rw-r--r-- | stdlib/format.ml | 7 | ||||
-rw-r--r-- | stdlib/format.mli | 10 | ||||
-rw-r--r-- | stdlib/hashtbl.ml | 5 | ||||
-rw-r--r-- | stdlib/hashtbl.mli | 2 | ||||
-rw-r--r-- | stdlib/listLabels.mli | 16 | ||||
-rw-r--r-- | stdlib/map.ml | 3 | ||||
-rw-r--r-- | stdlib/map.mli | 1 | ||||
-rw-r--r-- | stdlib/marshal.ml | 5 | ||||
-rw-r--r-- | stdlib/marshal.mli | 2 | ||||
-rw-r--r-- | stdlib/pervasives.ml | 10 | ||||
-rw-r--r-- | stdlib/pervasives.mli | 2 | ||||
-rw-r--r-- | stdlib/stdLabels.mli | 16 | ||||
-rw-r--r-- | stdlib/sys.ml | 1 | ||||
-rw-r--r-- | stdlib/sys.mli | 3 | ||||
-rw-r--r-- | stdlib/weak.ml | 3 | ||||
-rw-r--r-- | stdlib/weak.mli | 2 |
17 files changed, 24 insertions, 70 deletions
diff --git a/stdlib/Makefile b/stdlib/Makefile index f69f804e49..9a9d58823e 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -30,10 +30,10 @@ BASIC=pervasives.cmo array.cmo list.cmo char.cmo string.cmo sys.cmo \ buffer.cmo printf.cmo format.cmo arg.cmo printexc.cmo gc.cmo \ digest.cmo random.cmo oo.cmo genlex.cmo callback.cmo weak.cmo \ lazy.cmo filename.cmo int32.cmo int64.cmo nativeint.cmo -LABELLED=arrayLabels.ml listLabels.ml stringLabels.ml stdLabels.ml +LABELLED=arrayLabels.ml listLabels.ml stringLabels.ml -OBJS=$(BASIC) labelled.cmo -ALLOBJS=$(BASIC) $(LABELLED:.ml=.cmo) +OBJS=$(BASIC) labelled.cmo stdLabels.cmo +ALLOBJS=$(BASIC) $(LABELLED:.ml=.cmo) stdLabels.cmo all: stdlib.cma std_exit.cmo camlheader camlheader_ur diff --git a/stdlib/format.ml b/stdlib/format.ml index d3b3843d95..e36e2c0b12 100644 --- a/stdlib/format.ml +++ b/stdlib/format.ml @@ -566,12 +566,11 @@ let pp_set_formatter_output_functions state f g = let pp_get_formatter_output_functions state () = (state.pp_output_function, state.pp_flush_function);; -let pp_set_all_formatter_output_functions state f g h i = +let pp_set_all_formatter_output_functions state + ~out:f ~flush:g ~newline:h ~spaces:i = pp_set_formatter_output_functions state f g; state.pp_output_newline <- (function _ -> function () -> h ()); state.pp_output_spaces <- (function _ -> function n -> i n);; -let pp_set_all_formatter_output_functions' state ~out ~flush ~newline ~space = - pp_set_all_formatter_output_functions state out flush newline space let pp_get_all_formatter_output_functions state () = (state.pp_output_function, state.pp_flush_function, state.pp_output_newline state, state.pp_output_spaces state);; @@ -692,8 +691,6 @@ and get_formatter_output_functions = and set_all_formatter_output_functions = pp_set_all_formatter_output_functions std_formatter -and set_all_formatter_output_functions' = - pp_set_all_formatter_output_functions' std_formatter and get_all_formatter_output_functions = pp_get_all_formatter_output_functions std_formatter;; diff --git a/stdlib/format.mli b/stdlib/format.mli index c6123c3b18..d36a033fe2 100644 --- a/stdlib/format.mli +++ b/stdlib/format.mli @@ -242,11 +242,8 @@ val get_formatter_output_functions : (*** Changing the meaning of pretty printing (indentation, line breaking, and printing material) *) val set_all_formatter_output_functions : - (string -> int -> int -> unit) -> (unit -> unit) -> - (unit -> unit) -> (int -> unit) -> unit;; -val set_all_formatter_output_functions' : out:(string -> int -> int -> unit) -> flush:(unit -> unit) -> - newline:(unit -> unit) -> space:(int -> unit) -> unit;; + newline:(unit -> unit) -> spaces:(int -> unit) -> unit;; (* [set_all_formatter_output_functions out flush outnewline outspace] redirects the pretty-printer output to the functions [out] and [flush] as described in @@ -362,11 +359,8 @@ val pp_set_formatter_output_functions : formatter -> val pp_get_formatter_output_functions : formatter -> unit -> (string -> int -> int -> unit) * (unit -> unit);; val pp_set_all_formatter_output_functions : formatter -> - (string -> int -> int -> unit) -> (unit -> unit) -> - (unit -> unit) -> (int -> unit) -> unit;; -val pp_set_all_formatter_output_functions' : formatter -> out:(string -> int -> int -> unit) -> flush:(unit -> unit) -> - newline:(unit -> unit) -> space:(int -> unit) -> unit;; + newline:(unit -> unit) -> spaces:(int -> unit) -> unit;; val pp_get_all_formatter_output_functions : formatter -> unit -> (string -> int -> int -> unit) * (unit -> unit) * (unit -> unit) * (int -> unit);; diff --git a/stdlib/hashtbl.ml b/stdlib/hashtbl.ml index de0bee09b1..d39fd28a23 100644 --- a/stdlib/hashtbl.ml +++ b/stdlib/hashtbl.ml @@ -70,8 +70,6 @@ let add h key info = h.data.(i) <- bucket; if bucket_too_long h.max_len bucket then resize hash h -let add' h ~key ~data = add h key data - let remove h key = let rec remove_bucket = function Empty -> @@ -159,7 +157,6 @@ module type S = val create: int -> 'a t val clear: 'a t -> unit val add: 'a t -> key -> 'a -> unit - val add': 'a t -> key:key -> data:'a -> unit val remove: 'a t -> key -> unit val find: 'a t -> key -> 'a val find_all: 'a t -> key -> 'a list @@ -182,8 +179,6 @@ module Make(H: HashedType): (S with type key = H.t) = h.data.(i) <- bucket; if bucket_too_long h.max_len bucket then resize H.hash h - let add' h ~key ~data = add h key data - let remove h key = let rec remove_bucket = function Empty -> diff --git a/stdlib/hashtbl.mli b/stdlib/hashtbl.mli index ca1fdce3fe..b268eef36e 100644 --- a/stdlib/hashtbl.mli +++ b/stdlib/hashtbl.mli @@ -32,7 +32,6 @@ val clear : ('a, 'b) t -> unit (* Empty a hash table. *) val add : ('a, 'b) t -> 'a -> 'b -> unit -val add' : ('a, 'b) t -> key:'a -> data:'b -> unit (* [Hashtbl.add tbl x y] adds a binding of [x] to [y] in table [tbl]. Previous bindings for [x] are not removed, but simply hidden. That is, after performing [Hashtbl.remove tbl x], @@ -99,7 +98,6 @@ module type S = val create: int -> 'a t val clear: 'a t -> unit val add: 'a t -> key -> 'a -> unit - val add': 'a t -> key:key -> data:'a -> unit val remove: 'a t -> key -> unit val find: 'a t -> key -> 'a val find_all: 'a t -> key -> 'a list diff --git a/stdlib/listLabels.mli b/stdlib/listLabels.mli index e11f29c001..3c2f9d761e 100644 --- a/stdlib/listLabels.mli +++ b/stdlib/listLabels.mli @@ -117,10 +117,10 @@ val exists2 : f:('a -> 'b -> bool) -> 'a list -> 'b list -> bool (* Same as [for_all] and [exists], but for a two-argument predicate. Raise [Invalid_argument] if the two lists have different lengths. *) -val mem : 'a -> 'a list -> bool +val mem : 'a -> set:'a list -> bool (* [mem a l] is true if and only if [a] is equal to an element of [l]. *) -val memq : 'a -> 'a list -> bool +val memq : 'a -> set:'a list -> bool (* Same as [mem], but uses physical equality instead of structural equality to compare list elements. *) @@ -148,30 +148,30 @@ val partition : f:('a -> bool) -> 'a list -> 'a list * 'a list (** Association lists *) -val assoc : 'a -> ('a * 'b) list -> 'b +val assoc : 'a -> map:('a * 'b) list -> 'b (* [assoc a l] returns the value associated with key [a] in the list of pairs [l]. That is, [assoc a [ ...; (a,b); ...] = b] if [(a,b)] is the leftmost binding of [a] in list [l]. Raise [Not_found] if there is no value associated with [a] in the list [l]. *) -val assq : 'a -> ('a * 'b) list -> 'b +val assq : 'a -> map:('a * 'b) list -> 'b (* Same as [assoc], but uses physical equality instead of structural equality to compare keys. *) -val mem_assoc : 'a -> ('a * 'b) list -> bool +val mem_assoc : 'a -> map:('a * 'b) list -> bool (* Same as [assoc], but simply return true if a binding exists, and false if no bindings exist for the given key. *) -val mem_assq : 'a -> ('a * 'b) list -> bool +val mem_assq : 'a -> map:('a * 'b) list -> bool (* Same as [mem_assoc], but uses physical equality instead of structural equality to compare keys. *) -val remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) list +val remove_assoc : 'a -> map:('a * 'b) list -> ('a * 'b) list (* [remove_assoc a l] returns the list of pairs [l] without the first pair with key [a], if any. Not tail-recursive. *) -val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list +val remove_assq : 'a -> map:('a * 'b) list -> ('a * 'b) list (* Same as [remove_assq], but uses physical equality instead of structural equality to compare keys. Not tail-recursive. *) diff --git a/stdlib/map.ml b/stdlib/map.ml index f1fdaa6cdf..634753feb0 100644 --- a/stdlib/map.ml +++ b/stdlib/map.ml @@ -24,7 +24,6 @@ module type S = type +'a t val empty: 'a t val add: key -> 'a -> 'a t -> 'a t - val add': key:key -> data:'a -> 'a t -> 'a t val find: key -> 'a t -> 'a val remove: key -> 'a t -> 'a t val mem: key -> 'a t -> bool @@ -94,8 +93,6 @@ module Make(Ord: OrderedType) = struct else bal l v d (add x data r) - let add' ~key ~data t = add key data t - let rec find x = function Empty -> raise Not_found diff --git a/stdlib/map.mli b/stdlib/map.mli index 8fb691638d..61a7a8c166 100644 --- a/stdlib/map.mli +++ b/stdlib/map.mli @@ -45,7 +45,6 @@ module type S = val empty: 'a t (* The empty map. *) val add: key -> 'a -> 'a t -> 'a t - val add': key:key -> data:'a -> 'a t -> 'a t (* [add x y m] returns a map containing the same bindings as [m], plus a binding of [x] to [y]. If [x] was already bound in [m], its previous binding disappears. *) diff --git a/stdlib/marshal.ml b/stdlib/marshal.ml index 8f2bef00a3..cf49605d00 100644 --- a/stdlib/marshal.ml +++ b/stdlib/marshal.ml @@ -29,11 +29,6 @@ let to_buffer buff ofs len v flags = then invalid_arg "Marshal.to_buffer: substring out of bounds" else to_buffer_unsafe buff ofs len v flags -let to_buffer' ~buf:buff ~pos:ofs ~len v ~mode:flags = - if ofs < 0 || len < 0 || ofs + len > String.length buff - then invalid_arg "Marshal.to_buffer: substring out of bounds" - else to_buffer_unsafe buff ofs len v flags - external from_channel: in_channel -> 'a = "input_value" external from_string_unsafe: string -> int -> 'a = "input_value_from_string" external data_size_unsafe: string -> int -> int = "marshal_data_size" diff --git a/stdlib/marshal.mli b/stdlib/marshal.mli index 36ae1c9550..b3bfcba800 100644 --- a/stdlib/marshal.mli +++ b/stdlib/marshal.mli @@ -85,8 +85,6 @@ external to_string: 'a -> extern_flags list -> string [Marshal.to_channel]. *) val to_buffer: string -> int -> int -> 'a -> extern_flags list -> int -val to_buffer': - buf:string -> pos:int -> len:int -> 'a -> mode:extern_flags list -> int (* [Marshal.to_buffer buff ofs len v flags] marshals the value [v], storing its byte representation in the string [buff], starting at character number [ofs], and writing at most diff --git a/stdlib/pervasives.ml b/stdlib/pervasives.ml index eb121fed69..58408aace7 100644 --- a/stdlib/pervasives.ml +++ b/stdlib/pervasives.ml @@ -228,11 +228,6 @@ let output oc s ofs len = then invalid_arg "output" else unsafe_output oc s ofs len -let output' oc ~buf:s ~pos:ofs ~len = - if ofs < 0 || len < 0 || ofs + len > string_length s - then invalid_arg "output" - else unsafe_output oc s ofs len - external output_byte : out_channel -> int -> unit = "caml_output_char" external output_binary_int : out_channel -> int -> unit = "caml_output_int" @@ -269,11 +264,6 @@ let input ic s ofs len = then invalid_arg "input" else unsafe_input ic s ofs len -let input' ic ~buf:s ~pos:ofs ~len = - if ofs < 0 || len < 0 || ofs + len > string_length s - then invalid_arg "input" - else unsafe_input ic s ofs len - let rec unsafe_really_input ic s ofs len = if len <= 0 then () else begin let r = unsafe_input ic s ofs len in diff --git a/stdlib/pervasives.mli b/stdlib/pervasives.mli index 19afe246e3..a749529b9b 100644 --- a/stdlib/pervasives.mli +++ b/stdlib/pervasives.mli @@ -487,7 +487,6 @@ val output_char : out_channel -> char -> unit val output_string : out_channel -> string -> unit (* Write the string on the given output channel. *) val output : out_channel -> string -> int -> int -> unit -val output' : out_channel -> buf:string -> pos:int -> len:int -> unit (* Write [len] characters from string [buf], starting at offset [pos], to the given output channel. Raise [Invalid_argument "output"] if [pos] and [len] do not @@ -558,7 +557,6 @@ val input_line : in_channel -> string Raise [End_of_file] if the end of the file is reached at the beginning of line. *) val input : in_channel -> string -> int -> int -> int -val input' : in_channel -> buf:string -> pos:int -> len:int -> int (* Read up to [len] characters from the given channel, storing them in string [buf], starting at character number [pos]. It returns the actual number of characters read, between 0 and diff --git a/stdlib/stdLabels.mli b/stdlib/stdLabels.mli index b920fb446e..47c53301fe 100644 --- a/stdlib/stdLabels.mli +++ b/stdlib/stdLabels.mli @@ -72,18 +72,18 @@ module List : sig val exists : f:('a -> bool) -> 'a list -> bool val for_all2 : f:('a -> 'b -> bool) -> 'a list -> 'b list -> bool val exists2 : f:('a -> 'b -> bool) -> 'a list -> 'b list -> bool - val mem : 'a -> 'a list -> bool - val memq : 'a -> 'a list -> bool + val mem : 'a -> set:'a list -> bool + val memq : 'a -> set:'a list -> bool val find : f:('a -> bool) -> 'a list -> 'a val filter : f:('a -> bool) -> 'a list -> 'a list val find_all : f:('a -> bool) -> 'a list -> 'a list val partition : f:('a -> bool) -> 'a list -> 'a list * 'a list - val assoc : 'a -> ('a * 'b) list -> 'b - val assq : 'a -> ('a * 'b) list -> 'b - val mem_assoc : 'a -> ('a * 'b) list -> bool - val mem_assq : 'a -> ('a * 'b) list -> bool - val remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) list - val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list + val assoc : 'a -> map:('a * 'b) list -> 'b + val assq : 'a -> map:('a * 'b) list -> 'b + val mem_assoc : 'a -> map:('a * 'b) list -> bool + val mem_assq : 'a -> map:('a * 'b) list -> bool + val remove_assoc : 'a -> map:('a * 'b) list -> ('a * 'b) list + val remove_assq : 'a -> map:('a * 'b) list -> ('a * 'b) list val split : ('a * 'b) list -> 'a list * 'b list val combine : 'a list -> 'b list -> ('a * 'b) list val sort : cmp:('a -> 'a -> int) -> 'a list -> 'a list diff --git a/stdlib/sys.ml b/stdlib/sys.ml index 924f007b56..122a9620d1 100644 --- a/stdlib/sys.ml +++ b/stdlib/sys.ml @@ -25,7 +25,6 @@ let max_string_length = word_size / 8 * max_array_length - 1;; external file_exists: string -> bool = "sys_file_exists" external remove: string -> unit = "sys_remove" external rename : string -> string -> unit = "sys_rename" -external rename' : src:string -> dst:string -> unit = "sys_rename" external getenv: string -> string = "sys_getenv" external command: string -> int = "sys_system_command" external time: unit -> float = "sys_time" diff --git a/stdlib/sys.mli b/stdlib/sys.mli index 66d4fa2bec..4768d571e4 100644 --- a/stdlib/sys.mli +++ b/stdlib/sys.mli @@ -23,8 +23,7 @@ external file_exists: string -> bool = "sys_file_exists" (* Test if a file with the given name exists. *) external remove: string -> unit = "sys_remove" (* Remove the given file name from the file system. *) -external rename : string -> string -> unit = "sys_rename" -external rename' : src:string -> dst:string -> unit = "sys_rename" +external rename: string -> string -> unit = "sys_rename" (* Rename a file. The first argument is the old name and the second is the new name. *) external getenv: string -> string = "sys_getenv" diff --git a/stdlib/weak.ml b/stdlib/weak.ml index 944fbc60e5..b57cc64cc3 100644 --- a/stdlib/weak.ml +++ b/stdlib/weak.ml @@ -53,6 +53,3 @@ let blit ar1 of1 ar2 of2 len = end end ;; - -let blit' ~src ~src_pos ~dst ~dst_pos ~len = - blit src src_pos dst dst_pos len diff --git a/stdlib/weak.mli b/stdlib/weak.mli index 296ff6040f..1327086d30 100644 --- a/stdlib/weak.mli +++ b/stdlib/weak.mli @@ -68,8 +68,6 @@ val fill: 'a t -> int -> int -> 'a option -> unit;; if [ofs] and [len] do not designate a valid subarray of [a]. *) val blit : 'a t -> int -> 'a t -> int -> int -> unit;; -val blit' : src:'a t -> src_pos:int -> - dst:'a t -> dst_pos:int -> len:int -> unit;; (* [Weak.blit ar1 off1 ar2 off2 len] copies [len] weak pointers from [ar1] (starting at [off1]) to [ar2] (starting at [off2]). It works correctly even if [ar1] and [ar2] are the same. |