Boost logo

Boost :

From: Karl Nelson (kenelson_at_[hidden])
Date: 2000-08-22 19:27:28


> > but the implementation
> >has a rather large design area.
> >
> >Things to be decided like
> >
> > stream/manipulator like verses function like
>
> I vote for stream/manipulator like. Seems more in the spirit of iostreams,
> and that is the familiar model for C++ programmers.

I think we have settled on stream like after David's suggestion.
The templates could be made to work but were likely more problematic
then they were worth.

>
> > Unix 98 printf specification verses creating our own format
>
> I'd rather stick with a familiar format, unless we find so many small
> deviations that it becomes a different thing. If that happens, it might be
> less confusing to use an entirely different format. But it seems better to
> me to strive for C/C++ printf compatibility. (I'm not familiar with the
> Unxi 98 spec; boost usually tries to tie such things to the ISO C++
> standard.)

About the only place were there is likely to be a significant
difference is in centering and some of the more exotic modifiers
like #. However, I won't know until I have done some more extensive
testing. Many of the C++ streams commands have very different side
effects from the C ones. (like precision in decimal %.4d and float
%.4f mean very different things.) Also the specifier to take
argument from field '*' is utterly pointless in C++. Better to
drop it then to attempt to match such exotic functions.
Hopefully all issues can be resolved in my next submission.

Note that as far as I can tell the %n$ notation only appears
in the Open Group Unix 98 fprintf specs.

  http://www.opengroup.org/onlinepubs/7908799/xsh/fprintf.html

The C9X draft seems to omit any mention of rearrangement capability.
Nor could I find it in other ISO docs.
 
  http://www2.informatik.uni-wuerzburg.de/C9X_Draft/

Virtually all unix I could find contain the OpenGroup specs.
The HP-UX man page includes it with a statement of compliance
  
      fprintf(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1,
      ANSI C
                                    ^^^^^^^^^^^^^^^^
                                  Open Group spec 2-4.

( http://www.informatik.uni-frankfurt.de/doc/man/hpux/fprintf.3s.html )

Sun, FreeBSD, linux, Digital and other Unix variants I have checked all
conform. However, Microsoft does not and is labeled ANSI compliant. Thus
I must assume this is a Unix only extension.

Since ANSI/ISO does not address the issue I would assume XPG4 spec
would be the next spec to fall back on. Sorry, don't have access to
other major specs, POSIX for example. However, if anyone has a better
and more definitive source for a printf specification which includes
the argument rearranging I am happy to code to that.

C++ draft mentions nothing of printf other than it will be located
in cstdio. It appears that (v)form was a GNU extension, so
C++ has no reason to make any specification on formats. Thus
only the ISO and XPG specs are of any use.
  
(Okay can someone fill me in on why Unix and ISO have different
C fprintf formats???)

  
> > simple positional verses handles formating
> > full charT verses just a ostream and wostream
> >version
>
> I'm not sure yet about these.
>
> There is clearly lots of boost interest in your work. Now that you know
> our concerns, one way to proceed would be to go off-line, and develop a
> final proposal. Since Dave Abrahams issued the "Basic I/O" challenge, you
> might try using him as a sounding board along the way. Of course you are
> welcome to just keep thrashing things out on the full list, too.

Sounds good. My time is short for this week so I will work on this off
line for a while until I have something better prepared for
submission. Thanks for the comments.

--Karl


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk