| Anonymous | Login | Signup for a new account | 2013-06-20 04:21 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0002942 | OCaml | OCaml general | public | 2004-07-15 14:19 | 2012-01-30 15:15 | |||
| Reporter | administrator | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | feature | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | ||||||||
| Target Version | Fixed in Version | 3.10.0 | ||||||
| Summary | 0002942: Re: [Caml-list] kprintf with user formatters | |||||||
| Description | On 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 | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0006840) doligez (manager) 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 |