Two standard libraries?

renoX renosky at free.fr
Tue Jul 31 04:21:37 PDT 2007


Daniel Keep Wrote:
> renoX wrote:
> > I don't think that %08x{X} is ambiguous (and it has the advantage that it looks very much like printf formatter which is a plus in a language which is the successor of C/C++): anything between % and { is the 'formatter', anything inside {..} is the expression to be formatted.
> > 
> > Could you explain why you think it's ambiguous?
[]
> No, you're right; it's not ambiguous.  I suppose I just don't like that
> the format options aren't explicitly delimited by anything; the parser I
> wrote for mine is a bit stricter.
> 
> The other problem is that, as you said, it looks like a printf string.
> My personal stance is that unless printf syntax is actually valid, it
> shouldn't look like it is.

I agree that if it looks like printf then it should behave like printf: that's why the printf syntax was also valid in the function I made and that the same formater had the same result.

> I suppose it all boils down to taste in the end; viva-la-dollar! :)

Well, using printf-like formatter in a language which reuse C/C++ syntax make more sense to me, but sure that's a matter of taste and in any case your $ notation is far better than what there is currently in the libraries..

renoX
> 
> 	-- Daniel




More information about the Digitalmars-d mailing list