Two standard libraries?

renoX renosky at free.fr
Mon Jul 30 00:52:11 PDT 2007


Daniel Keep Wrote:
> Chris Nicholson-Sauls wrote:
> > renoX wrote:
> >> I'm surprised that Ruby doesn't allow puts "X is #08x{X}"..
> > 
> > Actually I feel much the same way.  If I ever find a clean way to code
> > my own formatter that can borrow the calling context.... I'll get
> > shivers.  (Probably have to write a Ruby extension in C to do so.)
> > 
> > -- Chris Nicholson-Sauls
> 
> Heh, my formatter supports "X is $(08x){X}" which is a bit longer, but
> non-ambiguous.  ^^

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?

Regards,
renoX

> 
> 	-- Daniel




More information about the Digitalmars-d mailing list