Re: [Caml-list] Private types in 3.11, again

2009-01-19 Thread Dario Teixeira
Hi, So my question is how can I make the Foobar code behave as if it were defined inside Node. Based on a previous thread [1], I'm guessing there is a solution, but I've been unable to hit on its exact formulation. There have been no replies yet to my question, but I'm still stuck with this

Visitor in OCaml [was Re: [Caml-list] C++/C# inheritance is bad?]

2009-01-19 Thread Yoann Padioleau
Jon Harrop j...@ffconsultancy.com writes: On Saturday 17 January 2009 14:35:22 Kuba Ober wrote: In contrast, metaprogramming is the pedagogical example for algebraic datatypes. There is almost no need for users to extend the abstract syntax tree but there is huge value in being able to

Re: Visitor in OCaml [was Re: [Caml-list] C++/C# inheritance is bad?]

2009-01-19 Thread blue storm
On 1/19/09, Yoann Padioleau pada...@wanadoo.fr wrote: What we want is really give code like let my_analysis program = analyze_all_expressions program (fun expr - match expr with | FunCall (e, es) - do_something() | _ - find_a_way_to_recurse_for_all_the_other_cases ) The

[Caml-list] Defining type that requires hashtables with recursive definition

2009-01-19 Thread Hugo Ferreira
Hello, I am attempting to define a type so: type node = | Node of links | Leaf of int And I want to implement links as a hashtable whose keys and values are also of type node. Note that the idea is to use object address comparison for the keys so: module H = struct type t = node

Re: [Caml-list] Defining type that requires hashtables with recursive definition

2009-01-19 Thread Jacques Carette
Hugo Ferreira wrote: I am attempting to define a type so: type node = | Node of links | Leaf of int And I want to implement links as a hashtable whose keys and values are also of type node. type node = | Node of links | Leaf of int and links = (node, node) Hashtbl.t should do it.

Re: Visitor in OCaml [was Re: [Caml-list] C++/C# inheritance is bad?]

2009-01-19 Thread Richard Jones
On Mon, Jan 19, 2009 at 05:41:35PM +0100, blue storm wrote: On 1/19/09, Yoann Padioleau pada...@wanadoo.fr wrote: What we want is really give code like let my_analysis program = analyze_all_expressions program (fun expr - match expr with | FunCall (e, es) - do_something()

[Caml-list] Re: Visitor in OCaml

2009-01-19 Thread Christophe TROESTLER
On Mon, 19 Jan 2009 17:41:35 +0100, blue storm wrote: On 1/19/09, Yoann Padioleau pada...@wanadoo.fr wrote: What we want is really give code like let my_analysis program = analyze_all_expressions program (fun expr - match expr with | FunCall (e, es) - do_something() | _

Re: [Caml-list] Defining type that requires hashtables with recursive definition

2009-01-19 Thread Thomas Gazagnaire
or if you really want to define your own equality, you can use recursive modules: module rec H : Hashtbl.HashedType = struct type node = | Node of node J.t | Leaf of int type t = node let equal (e1:node) (e2:node) = (==) e1 e2 let hash (e:node) = Hashtbl.hash e

Re: [Caml-list] Defining type that requires hashtables with recursive definition

2009-01-19 Thread Hugo Ferreira
Jacques Carette wrote: Hugo Ferreira wrote: I am attempting to define a type so: type node = | Node of links | Leaf of int And I want to implement links as a hashtable whose keys and values are also of type node. type node = | Node of links | Leaf of int and links = (node, node)

Re: [Caml-list] Defining type that requires hashtables with recursive definition

2009-01-19 Thread Hugo Ferreira
Thomas Gazagnaire wrote: or if you really want to define your own equality, you can use recursive modules: module rec H : Hashtbl.HashedType = struct type node = | Node of node J.t | Leaf of int type t = node let equal (e1:node) (e2:node) = (==) e1 e2 let hash

[Caml-list] [ANN] OCaml Meeting 2009 -- 5 days before end of subscription

2009-01-19 Thread Sylvain Le Gall
OCaml Meeting 2009 will take place in Grenoble on 4th February 2009. A subscription form can be found on the wiki page and a fee of 32€ will be used for the lunch. Subscription is mandatory for participants to this year meeting. As last year, participants are invited to give a talk on what they

[Caml-list] [ANN] React 0.9.0

2009-01-19 Thread Daniel Bünzli
Hello, I'd like to announce the following module. React is an OCaml module for functional reactive programming (frp). It provides support to program with time varying values : applicative events and signals. React doesn't define any primitive event or signal, this lets the client chooses

[Caml-list] [ANN] Rtime 0.9.0

2009-01-19 Thread Daniel Bünzli
Hello again, Related to my previous annoucement is the following module. Rtime is an OCaml module implementing timelines for React [1]. It manages time stamp events, delayed events and delayed signals along timelines. The client chooses the concrete timeline by providing an absolute