This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: new feature: s?printf parameter reordering
authorHugo van der Sanden <hv@crypt.org>
Thu, 11 Jan 2001 17:09:03 +0000 (17:09 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 19 Jan 2001 14:41:24 +0000 (14:41 +0000)
commit211dfcf14199529e353c08dea10d7050e6a4a22a
tree409f19012b858417450e93ece66ada0ef6dd1775
parentdb4b74455a92b07df967acd6d937f841399044da
Re: new feature: s?printf parameter reordering
Message-Id: <200101111709.RAA23756@crypt.compulink.co.uk>

- support reordering for all parameters: %, *v, *, .*
- lay down that the reordering specification must immediately
  follow that parameter: %3$, *v3$, *3$, .*3$
- fix vectorisation of a zero-length string
- factor out the code choosing the argument to format

Possibly unwanted side-effects:
- the special format specifiers ' +-0' must now precede any
  vectorisation specifier. Tests in op/sprintf and op/ver
  have been changed to reflect this.
- sprintf.t test #214 changed its expectations because in many
  cases, the next parameter has already been consumed when an
  invalid type letter is detected.

Probably wanted side-effects:
- attempts to format a non-existent parameter will warn as if C<undef>
- attempt to write to non-existent parameter with '%n' will complain
  of "attempt to modify read-only value" instead of being silent

p4raw-id: //depot/perl@8481
sv.c
t/op/sprintf.t
t/op/ver.t