Re: [Caml-list] interfacing Ocaml with Mathematica

2010-09-07 Thread Florent Ouchet
Hello, You might be interested in the evaluation core of VSyml [1], which is not Mathematica-based. The module DesignEval rewrites and evaluates function trees whose types are defined in the module DesignTypes. However, this project aims at symbolically simulate VHDL code, (by mixing

Re: [Caml-list] functor substitution gives error

2010-09-07 Thread Jacques Garrigue
On 2010/09/06, at 18:12, Hendrik Tews wrote: Hi, I have a strange compilation problem, which I suspect to be a compiler bug. Consider the following nested functor application module A(FreshGram : functor(Unit : sig end) - Camlp4Syntax) : Camlp4Syntax = FreshGram(struct end) module

Re: [Caml-list] functor substitution gives error

2010-09-07 Thread Daniel Bünzli
The solution is easy enough: name all modules. In my example all modules are named. Can you maybe provide an explanation of what's happening ? Best, Daniel ___ Caml-list mailing list. Subscription management:

Re: [Caml-list] ANN: ocamljs 0.3

2010-09-07 Thread Jake Donham
On Sun, Sep 5, 2010 at 6:05 AM, Christophe Papazian christophe.papaz...@gmail.com wrote: I was playing with ocamljs. It's very nice to use ocaml to produce javascript ! I have a question : in ocamljs, there is a support for style objects. However, I do not see how to use them usefully because

[Caml-list] [ANN] ocaml-expect v0.0.1: Expect-like framework

2010-09-07 Thread Sylvain Le Gall
This is a simple implementation of `expect` to help building unitary testing of interactive program. It helps to receive question and send answers from an interactive process. You can match the question using a regular expression (Str). You can also use a timeout to ensure that the process answer

Re: [Caml-list] functor substitution gives error

2010-09-07 Thread Jacques Garrigue
On Mon, Sep 6, 2010 at 6:39 PM, Daniel Bünzli daniel.buen...@erratique.ch wrote: I think I just hit the same kind problem. This doesn't compile : module A : sig type m module M : sig type t = m end end = struct module M = struct module S = String module Smap =

[Caml-list] C binding and GC interaction: storing values outside the heap

2010-09-07 Thread Paolo Donadeo
I'm writing a Lua API binding http://ocaml-lua.forge.ocamlcore.org/ and I have a problem regarding the interaction with the garbage collector. The situation is rather canonical: a particular C data type, the Lua statehttp://www.lua.org/manual/5.1/manual.html#lua_state, is used as argument in all

Re: [Caml-list] C binding and GC interaction: storing values outside the heap

2010-09-07 Thread Stéphane Glondu
Le 07/09/2010 22:58, Paolo Donadeo a écrit : I'm writing a Lua API binding [...] typedef struct ocaml_data { value state_value; value panic_callback; } ocaml_data; [...] /* alloc space for the register entry */ ocaml_data *data = (ocaml_data*)caml_stat_alloc(sizeof(ocaml_data));

Re: [Caml-list] C binding and GC interaction: storing values outside the heap

2010-09-07 Thread Paolo Donadeo
On Tue, Sep 7, 2010 at 23:12, Stéphane Glondu wrote: Why don't you call caml_register_global_root on (data-state_value) as well? This was a solution I tried, but with the additional global root the finalization function was never called by the GC, so it solved the segfault with a memory leak :-)

Re: [Caml-list] C binding and GC interaction: storing values outside the heap

2010-09-07 Thread Stéphane Glondu
Le 07/09/2010 23:23, Paolo Donadeo a écrit : Why don't you call caml_register_global_root on (data-state_value) as well? This was a solution I tried, but with the additional global root the finalization function was never called by the GC, so it solved the segfault with a memory leak :-)

Re: [Caml-list] C binding and GC interaction: storing values outside the heap

2010-09-07 Thread Damien Doligez
On 2010-09-07, at 22:58, Paolo Donadeo wrote: The problem is that, for several good reasons, I need a copy, or a reference, to the OCaml value representing the lua_State (v_L in the code above) inside the Lua state (I mean the C data structure). That creates a cross-heap reference loop and

[Caml-list] patterns for 3.12.0

2010-09-07 Thread Jake Donham
Hi list, If you are interested in using Jeremy Yallop's patterns extension on OCaml 3.12.0, I have fixed it up here: http://github.com/jaked/patterns I haven't tried anything serious with it but the tests pass. Also I added a little extension for alist patterns: a pattern alist [ foo, x;