English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
overhead of GC in caml runtime?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-08-08 (20:42)
From: Walid Taha <taha@c...>
Subject: Re: Imperative programming in Caml

Hi John,

> If you write:
> imperative call;
> let x = blah in
>   imperative call
> then you get a little distracted by the indentation.  

Got it!

> Mmm.  I don't think you're going to have much success at showing that
> O'Caml is a reasonable language without using at least some
> polymorphism.  Perhaps this restatement of my previous code would
> help, though:
> type optional_int =
>        | No_Int
>        | Some_Int of int

I feel you were "righter" the first time.  An "option" type is somehow
semanticaly implict in having "null/nill" in every pointer.  So, I think
it is reasonable to interpreter "'a pointer" as "'a option ref".  This
also suggests a naturally way to translate imperative programs to
functional programs systematically.

Thanks again for the great feedback.