Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement %C in sprintf in Rakudo #418

Closed
p6rt opened this issue Nov 19, 2008 · 7 comments
Closed

Implement %C in sprintf in Rakudo #418

p6rt opened this issue Nov 19, 2008 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 19, 2008

Migrated from rt.perl.org#60672 (status was 'rejected')

Searchable as RT60672$

@p6rt
Copy link
Author

p6rt commented Nov 19, 2008

From @masak

According to S29, there should be an sprintf directive %C, but Rakudo
r32874 doesn't recognize it​:

$ ./perl6 -e 'my $num = 12345; printf "%d%C is %d digits long", $num,
sub($s, @​args is rw) { @​args[2] = $s.elems }, 0;'
'C' is not a valid sprintf format
[...]

Depending on one's views of things, it may or may not be a bad thing
that the error message from a call to `printf` complains about valid
sprintf formats.

@p6rt
Copy link
Author

p6rt commented May 1, 2009

From @ronaldxs

Test added to t/spec/S32-str/sprintf.t.

@p6rt
Copy link
Author

p6rt commented May 1, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 21, 2010

From @ShimmerFairy

The error message when running

my $num = 12345; printf "%d%C is %d digits long", $num, sub($s, @​args
is rw) { @​args[2] = $s.elems }, 0;

is now

Unable to parse postcircumfix​:sym<( )>, couldn't find final ')' at line 11

--
Don't Panic!

@p6rt
Copy link
Author

p6rt commented Dec 29, 2011

From @masak

On Sun Mar 21 14​:11​:18 2010, lue wrote​:

The error message when running

my $num = 12345; printf "%d%C is %d digits long", $num, sub($s, @​args
is rw) { @​args[2] = $s.elems }, 0;

is now

Unable to parse postcircumfix​:sym<( )>, couldn't find final ')' at
line 11

No, that would be the error message you'd get if you paste the line with
an accidental line break after '@​args'.

If you remove the line break, you get​:

$ ./perl6 -e 'my $num = 12345; printf "%d%C is %d digits long", $num,
sub($s, @​args is rw) { @​args[2] = $s.elems }, 0;'
===SORRY!===
Variable $s is not predeclared at line 1, near ", @​args is"

because Rakudo is more strict with whitespace between the 'sub' and the
'(' nowadays.

Adding a space recreates the original error message​:

$ ./perl6 -e 'my $num = 12345; printf "%d%C is %d digits long", $num,
sub ($s, @​args is rw) { @​args[2] = $s.elems }, 0;'
'C' is not a valid sprintf format
  in sub sprintf at src/gen/CORE.setting​:1841
  in sub printf at src/gen/CORE.setting​:1846

@p6rt
Copy link
Author

p6rt commented Mar 29, 2012

From @moritz

%C has been removed from the specs, so we don't need to implement it
anymore.

@p6rt
Copy link
Author

p6rt commented Mar 29, 2012

@moritz - Status changed from 'open' to 'rejected'

@p6rt p6rt closed this as completed Mar 29, 2012
@p6rt p6rt added the Todo label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant