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
-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
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
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
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
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
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
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
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/
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
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
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
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://
>> ** 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,
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,
> 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
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
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.
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
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
--- 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
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:
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
23 matches
Mail list logo