summaryrefslogtreecommitdiff
path: root/stdlib/marshal.mli
diff options
context:
space:
mode:
authorWojciech Meyer <wojciech.meyer@gmail.com>2013-04-04 22:07:51 +0000
committerWojciech Meyer <wojciech.meyer@gmail.com>2013-04-04 22:07:51 +0000
commit93fc228b45aef944eeb708fa4f6fa24e0373af9c (patch)
tree8d943669d2ae01ee9af6a71f489f176008790b10 /stdlib/marshal.mli
parenta3f9e656682c7fee1cb3a9ff61626ea2b3840d41 (diff)
downloadocaml-93fc228b45aef944eeb708fa4f6fa24e0373af9c.tar.gz
PR#4978: add a warning to the Marshal module documentation about using marshaled exception.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13486 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/marshal.mli')
-rw-r--r--stdlib/marshal.mli12
1 files changed, 11 insertions, 1 deletions
diff --git a/stdlib/marshal.mli b/stdlib/marshal.mli
index 81a643f9eb..f9a0f53489 100644
--- a/stdlib/marshal.mli
+++ b/stdlib/marshal.mli
@@ -31,7 +31,17 @@
type of the returned value, using the following syntax:
- [(Marshal.from_channel chan : type)].
Anything can happen at run-time if the object in the file does not
- belong to the given type.
+ belong to the given type. Apart from that marshaling is not
+ type-safe, it's also risky to marshal exception or any OCaml values
+ of type that contains exception in it's defininition or in dependent
+ definitions. Although it's possible to marshal and unmarshal these
+ OCaml values, it's not possible anymore to match the exception
+ contained in it using match construct. The same principle applies
+ to code that raises and catches OCaml values of type exn that has
+ been unmarshaled before . This limitation comes from the fact that
+ the exceptions have no defined run-time tag, therefore the system
+ is unable to asses the exception clause and match it. Other means
+ of using marshalled exceptions in OCaml code are not affected.
The representation of marshaled values is not human-readable,
and uses bytes that are not printable characters. Therefore,