[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: "Gary V. Vaughan" <gary@...>
- Date: Tue, 20 Aug 2013 12:27:08 +0800
On Aug 20, 2013, at 11:44 AM, Miles Bader <miles@gnu.org> wrote:
> POSIX printf actually _does_ support explicit
> parameter indexing (and I believe translation strings are indeed the
> motivator for this).
>
> I don't know how many printf implementations actually implement this
> feature, but GNU libc certainly does.
And for those that don't, I once wrote a library called snprintfv,
which is currently used by a few GNU projects for portability of all
POSIX specifiers to architectures that don't have native support.
Even for those that do, snprintfv also supports custom specifiers if
you want to have e.g. %S serialise and display a struct from the
calling program, or whatever else you might imagine.
The motivation for snprintfv was to provide a way to add support for
printf like string formatting in an interpreted language implemented
in C - something that cannot be done with POSIX printf and friends.
Cheers,
--
Gary V. Vaughan (gary AT vaughan DOT pe)
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
- 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
- Re: printf is a crappy language in a crappy language (was Re: [OT] Lua community and Go language), Miles Bader