[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language)
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 19 Aug 2013 08:41:42 +0200
On Mon, Aug 19, 2013 at 1:02 AM, Tim Hill <drtimhill@gmail.com> wrote:
implicit rather than explicit parameter indexing, which makes
localization much harder (you can't change order in the format string
to match language needs w/o changing the argument order to the call as
well).
Which is why C# uses "strings {1} like {0]" (these can contain extra modifiers).
printf-like flags live on in string.format, but in Lua not such a
problem, since the runtime errors tend to be clearer.. Making up
other 'little languages' like "$(boo) is $(foo)" (or the above C#
style) is an easy exercise of course. The best we can do is check
these strings early, and fail hard. This is inconvenient, since we
then cannot have them inline, unless some there's some preprocessor
(and that seems overkill)
Modern C compilers do check (and complain bitterly about) printf flags at least.
C++'s << still seems an elegant solution, but you need to have a feel
for how the overload set of << operates with your types, especially
when adding an overload for a new type.
- References:
- [OT] Lua community and Go language, Lorenzo Donati
- Re: [OT] Lua community and Go language, Sven Olsen
- Re: [OT] Lua community and Go language, Gé Weijers
- Re: [OT] Lua community and Go language, Miles Bader
- Re: [OT] Lua community and Go language, Craig Barnes
- Re: [OT] Lua community and Go language, Rena
- Re: [OT] Lua community and Go language, Lorenzo Donati
- Re: [OT] Lua community and Go language, steve donovan
- printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language), Jay Carlson
- Re: printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language), William Ahern
- Re: printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language), Jay Carlson
- Re: printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language), Andres Perera
- Re: printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language), Jay Carlson
- Re: printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language), Andres Perera
- Re: printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language), Tim Hill