Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Buffer.add_fstring #6591

Closed
vicuna opened this issue Sep 30, 2014 · 1 comment
Closed

Add Buffer.add_fstring #6591

vicuna opened this issue Sep 30, 2014 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Sep 30, 2014

Original bug ID: 6591
Reporter: @dra27
Status: closed (set by @zoggy on 2014-09-30T11:06:17Z)
Resolution: won't fix
Priority: normal
Severity: feature
Version: 4.02.0+beta1 / +rc1
Category: standard library

Bug description

It would be useful to have a function in Buffer which accepts formatted (Printf) input.

Steps to reproduce

Very simple (but useful!) new function:

[stdlib/buffer.ml, after add_string]

let add_fstring b fmt = Printf.ksprintf (add_string b) fmt

[stdlib/buffer.mli, after add_string]

val add_fstring : t -> ('a, unit, string, unit) format4 -> 'a
(** [add_fstring b format arg1 ... argN] formats the arguments [arg1] to [argN] according to the format string [format] (see {!Printf.fprintf}) and appends this string at the end of the buffer [b].
@SInCE 4.02.1
*)

@vicuna
Copy link
Author

vicuna commented Sep 30, 2014

Comment author: @zoggy

This is function Printf.bprintf :
http://caml.inria.fr/pub/docs/manual-ocaml/libref/Printf.html#VALbprintf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant