caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* printf - partial application bug
@ 2001-01-04 19:53 Charles Martin
  2001-01-04 21:16 ` Pierre Weis
  0 siblings, 1 reply; 2+ messages in thread
From: Charles Martin @ 2001-01-04 19:53 UTC (permalink / raw)
  To: caml-list

I was surprised to discover that:

# List.iter2 (Printf.printf " (%d %d)") [1;2;3] [4;5;6];;
  (1 4)2 5)3 6)

It appears that a partially applied printf "forgets" everything up to the 
first format directive.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: printf - partial application bug
  2001-01-04 19:53 printf - partial application bug Charles Martin
@ 2001-01-04 21:16 ` Pierre Weis
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre Weis @ 2001-01-04 21:16 UTC (permalink / raw)
  To: Charles Martin; +Cc: caml-list

> I was surprised to discover that:
> 
> # List.iter2 (Printf.printf " (%d %d)") [1;2;3] [4;5;6];;
>   (1 4)2 5)3 6)
> 
> It appears that a partially applied printf "forgets" everything up to the 
> first format directive.

That's not a bug: it is a feature !

Have a look to the FAQ:

http://pauillac.inria.fr/caml/FAQ/FAQ_EXPERT-eng.html#printf

or (for french speaking camlers)

http://pauillac.inria.fr/caml/FAQ/FAQ_EXPERT-fra.html#printf

Best regards,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-01-04 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-04 19:53 printf - partial application bug Charles Martin
2001-01-04 21:16 ` Pierre Weis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).