Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002942OCamlOCaml generalpublic2004-07-15 14:192012-01-30 15:15
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.10.0 
Summary0002942: Re: [Caml-list] kprintf with user formatters
DescriptionOn Thu, 15 Jul 2004, Damien wrote:
> I had the same problem a month ago,
> I ended with the following ugly function:
>
> let log b fmt =
> if b then Printf.printf fmt
> else
> let rec f x = Obj.magic f in
> f fmt
> (* val f: bool -> ('a, out_channel, unit) format -> 'a *)
>
> (I think this is safe since f just eats its arguments,
> and gets typed with "-rectypes" : ('b->'a) as 'a)
>
> maybe a function "zprintf" could be added to Printf and Format to do
> this job ?

Thanks for the hint, this works for me! I also think that there should be
some kind of "zprintf"-function in the standard library. Forcing people
to use "-rectypes" or "Obj.magic" is evil.

Regards,
Markus

--
Markus Mottl http://www.oefai.at/~markus [^] markus@oefai.at

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006840)
doligez (administrator)
2012-01-30 15:15

This is available since 3.10.0 as Printf.ifprintf (typed like fprintf but ignores all its arguments).

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2012-01-30 15:15 doligez Note Added: 0006840
2012-01-30 15:15 doligez Status acknowledged => closed
2012-01-30 15:15 doligez Resolution open => fixed
2012-01-30 15:15 doligez Fixed in Version => 3.10.0
2012-01-30 15:15 doligez Description Updated View Revisions


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker