[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Keyed format specifier
- From: "A.S. Bradbury" <asbradbury@...>
- Date: Thu, 3 Jan 2008 23:30:02 +0000
On Jan 3, 2008 6:42 PM, Erik von Reis <evonreis@mohrandassociates.com> wrote:
> My apologies if this is the wrong place to suggest this, but how about
> adding a keyed format specifier for string.format?
>
> To me,
>
> string.format("%(foo)s = %(bar)d", {foo = "variable", bar = 22})
>
> which I stole from Python, would be very handy and fits comfortably into
> the primitive way I think about Lua.
To complement the excellent replies you've received so far, here's a
relevant page from the Lua wiki:
http://lua-users.org/wiki/StringInterpolation
Alex