summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1998-12-08 14:53:55 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1998-12-08 14:53:55 +0000
commit1c47e1d33035685ca31821129c067f10573acb44 (patch)
treebbca770fa973dd81e26986afc0c95137a96b7483
parentfacd68e5dcc1fedb11d7d089f5203c577113e076 (diff)
downloadocaml-1c47e1d33035685ca31821129c067f10573acb44.tar.gz
Passage version 2.01
Pervasives: ajout int_of_char, char_of_int Char: suppression int_of_char, char_of_int git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2229 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--Changes13
-rw-r--r--otherlibs/threads/pervasives.ml7
-rw-r--r--stdlib/char.ml2
-rw-r--r--stdlib/char.mli4
-rw-r--r--stdlib/pervasives.ml7
-rw-r--r--stdlib/pervasives.mli20
-rw-r--r--utils/config.mlp2
7 files changed, 43 insertions, 12 deletions
diff --git a/Changes b/Changes
index 4630009491..1cdde03330 100644
--- a/Changes
+++ b/Changes
@@ -41,7 +41,13 @@ Objective Caml 2.01:
- Declaration of string_length in <caml/mlvalues.h>.
* Standard library:
- - Added List.mem_assoc, List.mem_assq, List.remove, List.removeq.
+ - Module Format: added {get,set}_all_formatter_output_functions,
+ formatter_of_out_channel, and the control sequence @<n> in printf.
+ - Module List: added mem_assoc, mem_assq, remove, removeq.
+ - Module Pervasives: added float_of_int (synonymous for float),
+ int_of_float (truncate), int_of_char (Char.code), char_of_int (Char.chr),
+ bool_of_string.
+ - Module String: added contains, contains_from, rcontains_from.
* Unix library:
- Unix.lockf: added F_RLOCK, F_TRLOCK; use POSIX locks whenever available.
@@ -61,6 +67,11 @@ Objective Caml 2.01:
* Emacs editing mode: updated with Jacques Garrigue's newest code.
+* Windows port:
+ - Added support for the "-cclib -lfoo" option (instead of
+ -cclib /full/path/libfoo.lib as before).
+ - Threads: fixed a bug at initialization time.
+
* Macintosh port: source code for Macintosh application merged in.
diff --git a/otherlibs/threads/pervasives.ml b/otherlibs/threads/pervasives.ml
index c2834ac983..9da4d15d8e 100644
--- a/otherlibs/threads/pervasives.ml
+++ b/otherlibs/threads/pervasives.ml
@@ -125,6 +125,13 @@ let (^) s1 s2 =
string_blit s2 0 s l1 l2;
s
+(* Character operations -- more in module Char *)
+
+external int_of_char : char -> int = "%identity"
+external unsafe_char_of_int : int -> char = "%identity"
+let char_of_int n =
+ if n < 0 or n > 255 then invalid_arg "char_of_int" else unsafe_char_of_int n
+
(* Pair operations *)
external fst : 'a * 'b -> 'a = "%field0"
diff --git a/stdlib/char.ml b/stdlib/char.ml
index 2d5bb24585..deb477cb04 100644
--- a/stdlib/char.ml
+++ b/stdlib/char.ml
@@ -14,12 +14,10 @@
(* Character operations *)
external code: char -> int = "%identity"
-external int_of_char: char -> int = "%identity"
external unsafe_chr: int -> char = "%identity"
let chr n =
if n < 0 or n > 255 then invalid_arg "Char.chr" else unsafe_chr n
-let char_of_int = chr
external is_printable: char -> bool = "is_printable"
diff --git a/stdlib/char.mli b/stdlib/char.mli
index 64544621fe..f69e8fda1b 100644
--- a/stdlib/char.mli
+++ b/stdlib/char.mli
@@ -15,14 +15,10 @@
external code : char -> int = "%identity"
(* Return the ASCII code of the argument. *)
-external int_of_char : char -> int = "%identity"
- (* Alias of the [code] function above. *)
val chr: int -> char
(* Return the character with the given ASCII code.
Raise [Invalid_argument "Char.chr"] if the argument is
outside the range 0--255. *)
-val char_of_int : int -> char
- (* Alias of the [chr] function above. *)
val escaped : char -> string
(* Return a string representing the given character,
with special characters escaped following the lexical conventions
diff --git a/stdlib/pervasives.ml b/stdlib/pervasives.ml
index 9819c1c5c5..5de1b45623 100644
--- a/stdlib/pervasives.ml
+++ b/stdlib/pervasives.ml
@@ -121,6 +121,13 @@ let (^) s1 s2 =
string_blit s2 0 s l1 l2;
s
+(* Character operations -- more in module Char *)
+
+external int_of_char : char -> int = "%identity"
+external unsafe_char_of_int : int -> char = "%identity"
+let char_of_int n =
+ if n < 0 or n > 255 then invalid_arg "char_of_int" else unsafe_char_of_int n
+
(* Pair operations *)
external fst : 'a * 'b -> 'a = "%field0"
diff --git a/stdlib/pervasives.mli b/stdlib/pervasives.mli
index 363eff8cde..b9c383a1bb 100644
--- a/stdlib/pervasives.mli
+++ b/stdlib/pervasives.mli
@@ -276,15 +276,13 @@ external modf : float -> float * float = "modf_float" "modf"
(* [modf f] returns the pair of the fractional and integral
part of [f]. *)
external float : int -> float = "%floatofint"
- (* Convert an integer to floating-point. *)
external float_of_int : int -> float = "%floatofint"
- (* Alias of [float] above. *)
+ (* Convert an integer to floating-point. *)
external truncate : float -> int = "%intoffloat"
+external int_of_float : float -> int = "%intoffloat"
(* Truncate the given floating-point number to an integer.
The result is unspecified if it falls outside the
range of representable integers. *)
-external int_of_float : float -> int = "%intoffloat"
- (* Alias of [truncate] above. *)
(*** String operations *)
@@ -293,6 +291,20 @@ external int_of_float : float -> int = "%intoffloat"
val (^) : string -> string -> string
(* String concatenation. *)
+(*** Character operations *)
+
+external int_of_char : char -> int = "%identity"
+ (* Return the ASCII code of the argument. *)
+val char_of_int : int -> char
+ (* Return the character with the given ASCII code.
+ Raise [Invalid_argument "char_of_int"] if the argument is
+ outside the range 0--255. *)
+
+(* More character operations are provided in module [Char]. *)
+
+val (^) : string -> string -> string
+ (* String concatenation. *)
+
(*** String conversion functions *)
val string_of_bool : bool -> string
diff --git a/utils/config.mlp b/utils/config.mlp
index ecadbdde8f..c98732cc6a 100644
--- a/utils/config.mlp
+++ b/utils/config.mlp
@@ -11,7 +11,7 @@
(* $Id$ *)
-let version = "2.00+5"
+let version = "2.01"
let standard_library =
try