Browse thread
[Caml-list] poll - need for a good introductory OCaml book
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jacques Garrigue <garrigue@k...> |
| Subject: | RE: [Caml-list] poll - need for a good introductory OCaml book |
From: "MikhailFedotov" <mikhail@kittown.com>
> > Mind explaining what's wrong with ``Developing Applications
> > in Ocaml'' ?
>
> The introductory part of reference manual reads easier. And there
> is a bug too in the book (at least one, I don't know if there are more):
>
> # let test_nul_integer = function `Number n -> n=0
> and test_nul_real = function `Number r -> r=0.0 ;;
> val test_nul_integer : [< `Number of int] -> bool = <fun>
> val test_nul_real : [< `Number of float] -> bool = <fun>
> # let test_nul x = (test_nul_integer x) || (test_nul_real x) ;;
>
> (the next line is wrong - ocaml 3.06 won't allow this):
>
> val test_nul : [< `Number of float & int] -> bool = <fun>
>
> Reference manual explains where is the bug...
The appendix of the book is explicitly about ocaml-2.99.
Lots of things changed since, so this is not surprising that new
features do not work exactly as explained in the book.
For this example, this is a rather recent change, to catch stupid
errors, the above being useless anyway.
Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners