develooper Front page | perl.perl6.language | Postings from July 2006

Re: sprintf and snake envy

Thread Previous | Thread Next
Nicholas Clark
July 4, 2006 09:27
Re: sprintf and snake envy
Message ID:
On Tue, Jul 04, 2006 at 05:06:54PM +1000, Brad Bowman wrote:
> Hello,
> It seems that sprintf is will still be around in Perl 6 [1],
> and that sprintf formats will be available using the .as() method.
> While looking at some Python docs [2] I noticed two things that might
> be worth stealing; a sprintf operator (%) and named parameters in 
> the format string:
> a = '%(lang)s has %(c)03d quote types.' % {'c':2, 'lang':'Python}

> The operator need is less clear cut.  Overloading '%' certainly wouldn't
> make sense in Perl 6 and the presence of .as() may cover the common cases.

I'm not convinced that sprintf needs an operator. It's not commonly used in
any code I've looked at, which to me suggests that it's not good huffman
coding to use up a terse symbol for it, denying that symbol to something

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About