Re: [Caml-list] on polymorphic compare and objects

2008-09-03 Thread Peng Zang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wednesday 03 September 2008 02:31:10 am Alain Frisch wrote: > Peng Zang wrote: > > For objects, we require that all objects > > implement an equal method that satisfies the semantic contract. > > How do you ensure that the method is indeed implemen

[Caml-list] toplevel not executed: Bug ?

2008-09-03 Thread Romain Beauxis
Hi all ! I've encountered a strange bug while preparing a caml module with C function. Depending on the execution of a caml-defined function, the toplevel is evaluated or not, leading to a segfault when calling a caml callback from C. The code of the C part is: <--- #include #include

[Caml-list] is there a switch or cond-statement? nested functions?

2008-09-03 Thread circ ular
thanks, the type problem is solved. but is there a way to write nested functions? so the powerf isn't exposed outwards... and how can I rewrite the if statements in a case or cond way? pattern mathcing is only on types right? cond a la scheme would be nice. let rec powerf(n, pow, acc) = if po

Re: [Caml-list] is there a switch or cond-statement? nested functions?

2008-09-03 Thread Christophe TROESTLER
On Wed, 3 Sep 2008 19:08:33 +0200, circ ular wrote: > > thanks, the type problem is solved. but is there a way to write nested > functions? so the powerf isn't exposed outwards... > > and how can I rewrite the if statements in a case or cond way? pattern > mathcing is only on types right? cond a

Re: [Caml-list] is there a switch or cond-statement? nested functions?

2008-09-03 Thread Daniel Bünzli
Le 3 sept. 08 à 19:24, Christophe TROESTLER a écrit : May I suggest [...] 3. Have a look at the the programming guidelines [1]. In particular, this point [2] may show you a cond is not needed to make your code nice and readable. Best, Daniel [1] http://caml.inria.fr/resources/doc/gui

Re: [Caml-list] toplevel not executed: Bug ?

2008-09-03 Thread Stéphane Glondu
Romain Beauxis wrote: > I've encountered a strange bug while preparing a caml module with C function. > Depending on the execution of a caml-defined function, the toplevel is > evaluated or not, leading to a segfault when calling a caml callback from C. > [...] I don't know whether this is a bug