Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Exceptions and C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Basile STARYNKEVITCH <basile@s...>
Subject: [Caml-list] Exceptions and C
>>>>> "Mitchell" == Mitchell N Charity <mcharity@vendian.org> writes:

    Mitchell> I gather run-time type checking is not occurring.  Can I
    Mitchell> at least count on avoiding a segfault, or is behavior
    Mitchell> completely undefined if callback arguments are
    Mitchell> incorrectly typed?

Behavior is undefined. For details, read the Chapter 18 "Interfacing C
with Objective Caml" of the reference manual. To understand what is
happening, read the section 18.2 (the value type) - or read the source
of the runtime system.

And there is a reason for that. The whole philosophy of Ocaml is
static typing, which the OCaml team pushes to the extreme (for
instance by refusing dynamic casting or class checking for objects).

I miss more dynamic ability of the object part of Ocaml (even if this
means having a tree of classes, not a forest, and reject multiple
inheritance).



-- 

Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net 
alias: basile<at>tunes<dot>org 
8, rue de la Faïencerie, 92340 Bourg La Reine, France
-------------------
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