Re: [Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Goswin von Brederlow
Peng Zang writes: > Hi, > > Here's an example of how constraints are specified for polymorphic methods. > In this example I define a list type which can compare to anything that is > foldable. > > class type ['a] foldable = object > method foldl : 'z. ('z -> 'a -> 'z) -> 'z -> 'z > end

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Peng Zang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Here's an example of how constraints are specified for polymorphic methods. In this example I define a list type which can compare to anything that is foldable. class type ['a] foldable = object method foldl : 'z. ('z -> 'a -> 'z) -> 'z

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Goswin von Brederlow
Hi, small add on to my last mail. Think of it as having a set of work queues: clean, dirty, reading, writing, write_prepare. The objects need to be able to quickly jump from one queue to the back of another when the objects internal state changes. And is not only the objects at the head of the qu

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Goswin von Brederlow
Martin Jambon writes: > Goswin von Brederlow wrote: >> Hi, >> >> I want to keep a linked list of structures that have a common subset >> of functionality. I thought this would be a good use of ocaml objects. > > It is not a good use of objects. You'll notice this pretty soon as you'll run > into

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Martin Jambon
Martin Jambon wrote: > Use a classic list: > > > class base = ... > class derived = ... (* inherits base *) > > type obj = Base of base | Derived of derived > > let obj_list = [ Base (new base); Derived (new derived); ... ] > > let iter_base f l = > List.iter (function Base x -> f x | Derive

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Martin Jambon
Goswin von Brederlow wrote: > Hi, > > I want to keep a linked list of structures that have a common subset > of functionality. I thought this would be a good use of ocaml objects. It is not a good use of objects. You'll notice this pretty soon as you'll run into a variety of problems: - polymorp

[Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Goswin von Brederlow
Hi, I want to keep a linked list of structures that have a common subset of functionality. I thought this would be a good use of ocaml objects. A base class with the common subset of functionality and methods to link them. And then derived classes for the specific types. Most simplified it looks l

Re: [Caml-list] questions

2009-03-31 Thread Jon Harrop
On Tuesday 31 March 2009 14:37:05 Kuba Ober wrote: > There must be some reason why the manual and other materials on the > official site are of such poor quality. FWIW, I think the OCaml manual is superb and under-appreciated. > Jon's > book, and Marcelo DiPierro's web2py book. Both are very good

Re: [Caml-list] ANNOUNCE: ocaml-autoconf macros 1.0 released

2009-03-31 Thread Richard Jones
I also wrote something about how to get started with OCaml & autoconf: http://rwmj.wordpress.com/2009/03/31/using-autoconf-for-ocaml-projects/ Rich. -- Richard Jones Red Hat ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/

[Caml-list] OCaml-based logic and theorem proving book available

2009-03-31 Thread Harrison, John R
I'm pleased to announce the availability of my textbook on logic and automated theorem proving, in which all the major techniques that are described are also implemented as concrete OCaml code: Handbook of Practical Logic and Automated Reasoning John Harrison

Re: [Caml-list] Dynamic loading of native code : what about librairies and packs ?

2009-03-31 Thread Alain Frisch
Pierre-Loïc Garoche wrote: Do you suggest to create a first cmx pack and then make it dynamically loadable ? Yes, absolutely. -- Alain ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Arch

[Caml-list] Re: ANNOUNCE: ocaml-autoconf macros 1.0 released

2009-03-31 Thread Sylvain Le Gall
Hello, On 31-03-2009, Richard Jones wrote: > > * OCamlForge, Debian & Red Hat ^^ I will really need to buy this DNS name for forge.ocamlcore.org ;-) Thanks for ocaml-autoconf Regards, Sylvain Le Gall ___ Caml-list mailing list. Subscrip

[Caml-list] ANNOUNCE: ocaml-autoconf macros 1.0 released

2009-03-31 Thread Richard Jones
We've just released the first version of the 'official' OCaml autoconf macros. Now there is a central place to collect autoconf macros related to detecting OCaml, OCaml tools and OCaml libraries. Everything has been relicensed under a simple 3-clause BSD license (or rewritten). Home: https://

Re: [Caml-list] Dynamic loading of native code : what about librairies and packs ?

2009-03-31 Thread Pierre-Loïc Garoche
>> ** Second: how about packs ? > > As far as I can tell, packing and creating cmxs files are orthogonal > features: they don't overlap and they don't have bad interactions. It is > ok to put in cmxs files a module produced by -pack. I think it is also > ok to put modules compiled with -for-pack,

Re: [Caml-list] Dynamic loading of native code : what about librairies and packs ?

2009-03-31 Thread Alain Frisch
Pierre-Loïc Garoche wrote: ** First: what about external libraries ? Could you detail the behavior of the linking process of cmxs file with respect to dependancies. If I understand well any library used to compile cmx files should be - either know by the software dynamically loading the plugin,

Re: [Caml-list] questions

2009-03-31 Thread Xavier Leroy
> There must be some reason why the manual and other materials on the > official site are of such poor quality. I've thought a bit about it, and > the only reason I see is that the authors do not have a feel for what it > takes to learn/understand/use that language. They obviously know it all > thr

[Caml-list] Dynamic loading of native code : what about librairies and packs ?

2009-03-31 Thread Pierre-Loïc Garoche
I am discovering this feature of loading dynamically native code. The Frama-C framework (www.frama-c.cea.fr) provides now a plugin architecture that allows you to develop your own plugin and loads it directly in the framework. I targeted to adapt a simple tool I developped as a Frama-C plugin and

Re: [Caml-list] when OO is wrong

2009-03-31 Thread Raoul Duke
also, check out http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora151.html ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.

Re: [Caml-list] questions

2009-03-31 Thread Martin Jambon
Kuba Ober wrote: > There must be some reason why the manual and other materials on the > official site are of such poor quality. I've thought a bit about it, and > the only reason I see is that the authors do not have a feel for what it > takes to learn/understand/use that language. They obviously

Re: [Caml-list] questions

2009-03-31 Thread Kuba Ober
the following are the most visible ocaml tutorials, but are low quality, blog like, full of misleading characterizations, irrevelancies, misleading comparisons. The type that you'd spend hours on and got more confused, regardless whether you are a expert logician or expert industrial prog

Re: [Caml-list] when OO is wrong

2009-03-31 Thread Ed Keith
--- On Tue, 3/31/09, Oliver Bandel wrote: > Quoting "Jon Harrop" : > > On Monday 30 March 2009 23:38:45 Ed Keith wrote: > >> I do wish I had better tools for visualizing FP designs. I use > >> Nassi-Schneiderman diagram for procedural designs and UML of OO designs. > > > > That's an interesting

Re: [Caml-list] integer regular expressions

2009-03-31 Thread Florent Ouchet
Martin Jambon a écrit : You want something called "views" or "active patterns". You can do that in OCaml with mikmatch, which includes such syntax extension. See http://martin.jambon.free.fr/mikmatch-manual.html#htoc10 Here is your example: let view Mod30 = fun x -> x mod 30 = 0 (* but not:

Re: [Caml-list] when OO is wrong

2009-03-31 Thread Oliver Bandel
Quoting "Jon Harrop" : On Monday 30 March 2009 23:38:45 Ed Keith wrote: I do wish I had better tools for visualizing FP designs. I use Nassi-Schneiderman diagram for procedural designs and UML of OO designs. That's an interesting idea. Someone must have worked on this? [...] In the book "Ha