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] Missing tabs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-10-26 (15:28)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Missing tabs
On Sun, Oct 26, 2003 at 01:17:58PM +0100, Nicolas George wrote:
> Le quintidi 5 brumaire, an CCXII, Richard Jones a 'ecrit:
> > # List.iter (printf "\t%s\n") ["foo"; "bar"; "baz"; "buz"];;
> This is a FAQ: you can not partially apply the format string of
> printf-like functions. Try (fun x -> printf "\t%s\n" x) instead.

I've now read:

Hmmm ... This does appear to violate the principle of least surprise.


  let g = Printf.printf " ** %i";;

is supposed to be equivalent to:

  let g = print_string " ** "; fun i -> print_int i;;

I would say that it should be equivalent to:

  let g = fun i -> (print_string " ** "; print_int i);;

and that the other behaviour is a bug, even if there are
implementation reasons why it is otherwise ...

Just my EUR 0.02.


Richard Jones.
Merjis Ltd. - all your business data are belong to you.
MAKE+ is a sane replacement for GNU autoconf/automake. One script compiles,
RPMs, pkgs etc. Linux, BSD, Solaris.

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