lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 19 August 2015 at 16:05, Stephan Hennig <sh-list@posteo.net> wrote:
> Am 18.08.2015 um 16:54 schrieb John Hind:
>
>> for a highly specialised use-case gets in! Not to mention yet another
>> arbitrary syntax with zero learnability (to join such bug-inducing horrors
>> as escapes in string literals, regular expression patterns and string format
>> codes)
>
> string.format is an alien within the string library.  A better place for
> that function were, e.g., the io library.  format() is not about
> manipulating strings but its purpose is type conversion in preparation
> of outputting values.

I write stuff such as ("foo = %s:%d"):format(bla, num) all the time
and I think it's entirely logical that a function for generating
formatted strings is called string.format (also, I wish I lived in a
parallel universe where priorities were such that I could drop the
parentheses around that literal string...).

-- Hisham