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

minor feature request: printf and binary digits #6249

Closed
vicuna opened this issue Oct 14, 2002 · 3 comments
Closed

minor feature request: printf and binary digits #6249

vicuna opened this issue Oct 14, 2002 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Oct 14, 2002

Original bug ID: 1438
Reporter: administrator
Status: closed (set by @xavierleroy on 2013-08-31T10:46:10Z)
Resolution: suspended
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Related to: #8136

Bug description

Scanf supports reading binary via %i, but Printf does not support
printing binary (%b is taken by boolean, which is symmetric with
scanf). Perhaps %B?

Chris

@vicuna
Copy link
Author

vicuna commented Oct 15, 2002

Comment author: administrator

Scanf supports reading binary via %i, but Printf does not support
printing binary (%b is taken by boolean, which is symmetric with
scanf). Perhaps %B?

Chris

You will be glad to know that the working sources for Scanf and Printf
treat %b as binary notation for integers and %B as a boolean Caml token
(symetrically to %C and %S).

An experimental binary printing implementation is also included in
Printf. It has to be reworked and generalized (or drastically
simplified) but is functionning.

Best regards,

Pierre Weis

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

@vicuna
Copy link
Author

vicuna commented Jul 1, 2003

Comment author: administrator

Implemented by PW 2002-10-15
removed by DD 2003-07-01 because of incompatibility problems (#8136)

@vicuna
Copy link
Author

vicuna commented Jan 25, 2012

Comment author: @damiendoligez

There doesn't seem to be much demand for this feature. If someone can come up with a compelling argument, a good choice of letter (given that B and b are already taken), and a patch, we might include it.

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