Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] kprintf with user formatters
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-21 (17:41)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: lazyness in ocaml (was : [Caml-list] kprintf with user formatters)

Le 21 juil. 04, à 17:52, Pierre Weis a écrit :

> The drawback is that you would have to write (lazy expr)
> for each argument ``expr'' to be printed. Quite a bit intrusive, I 
> think.
I agree. I once tried to port some haskell combinators [1] to ocaml. 
However I had to stop since using them meant cluttering your code with 
(lazy e) and lead to unreadable code.

A more lightweight notation would be needed in order to do real lazy 
programming in ocaml. At that time I wondered if specifiying the 
lazyness when one defines the function and not when one uses it would 
be a problem (I mean a technical problem, not an ideological one).
For example if one defines

let f (lazy x) = ...

then the application f (x + y) would implicitely mean f (lazy (x + y)). 
Alternatively something less intrusive than the keyword 'lazy' would be 


[1] <>

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: