From f891058937e546d1a57139b72496d19813b438e0 Mon Sep 17 00:00:00 2001 From: pmichaud Date: Wed, 4 Jul 2012 14:37:08 -0500 Subject: [PATCH] [S32]: Remove 'm' (complex) modifier from sprintf, in hopes of a more unified approach to formatted printing for Perl 6 (e.g., what about formatting Rats?). The idea here is to take a minimalist approach to 'sprintf' -- supplying the conversions that people are familiar with from other languages and libraries, but be cautious about layering on new "ad-hoc"-ish options until we have a better plan for handling them all. This is addressed further in https://github.com/perl6/specs/issues/13 . --- S32-setting-library/Str.pod | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/S32-setting-library/Str.pod b/S32-setting-library/Str.pod index f83e66a99..9ad7972e4 100644 --- a/S32-setting-library/Str.pod +++ b/S32-setting-library/Str.pod @@ -446,25 +446,21 @@ Perl 5 (non-)compatibility: n produces a runtime exception p produces a runtime exception -Modifiers change the meaning of format directives. The most important being -support for complex numbers (a basic type in Perl). Here are all of the -modifiers and what they modify: +Modifiers change the meaning of format directives. At the moment +these are recognized primarily for compatibility with C +from other languages (notably C and PerlĀ 5), but their exact semantics +are still conjectural. h interpret integer as native "short" (typically int16) l interpret integer as native "long" (typically int32 or int64) ll interpret integer as native "long long" (typically int64) L interpret integer as native "long long" (typically uint64) q interpret integer as native "quads" (typically int64 or larger) - m interpret value as a complex number - -The C modifier works with C and C format -directives, and the directive applies to both the real and imaginary -parts of the complex number. Examples: - sprintf "%ld a big number, %lld a bigger number, %mf complexity\n", - 4294967295, 4294967296, 1+2i); + sprintf "%ld a big number, %lld a bigger number\n", + 4294967295, 4294967296; =item fmt