Re: [Caml-list] Include question

2011-11-09 Thread Vincent Aravantinos
On 11/09/2011 02:29 AM, Cedric Cellier wrote: For some reasons though, despite functors being one of the greatest strength of the language, we do seam shy to use, recommand or brag about them. I wonder if this is due to the lack of proper documentation ? I don't think there is a lack of

[Caml-list] Include question

2011-11-08 Thread Hans Ole Rafaelsen
Hi, I'm trying to create a mockup module to replace a network module when doing testing. The application consists of basically 3 parts. Some user interaction. This calls some logic of the application, and the logic module might need to call some other functions over the network. For testing I

Re: [Caml-list] Include question

2011-11-08 Thread Hans Ole Rafaelsen
I was hoping not to have to change the interfaces of the application. Most of the application is already written and the testing was just an afterthought :-( But it might not be that much that need to be changed. I'll give it a shot. Thanks On Tue, Nov 8, 2011 at 4:10 PM, Gabriel Scherer

Re: [Caml-list] Include question

2011-11-08 Thread Alexandre Pilkiewicz
On Tue, Nov 8, 2011 at 10:10 AM, Gabriel Scherer gabriel.sche...@gmail.com wrote: If you want some module of your system to be parametrized by another module (to be able to pass either a concrete module or a mockup module), you should use a functor. And if you don't want to pollute your entire

Re: [Caml-list] Include question

2011-11-08 Thread Thomas Gazagnaire
You can have a look at http://www.ocamlpro.com/code/2011-08-10-ocaml-pack-functors.html It describes how to use either a patched version of OCaml or some external tools to automatically functorize modules to solve your problems. -- Thomas On Nov 8, 2011, at 4:45 PM, Hans Ole Rafaelsen wrote:

Re: [Caml-list] Include question

2011-11-08 Thread Cedric Cellier
And if you don't want to pollute your entire code with functor when it's in fact for testing and not part of the logic of the application, Functor seams the way to go here. The use of this technique as envisaged here is hardly invading, and comes with many advantages : Functors help