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
routines sprintf and printf need auto newline capability #5661
Comments
From @tbrowderBoth routines need an alias (or adverb) so that a newline is automatically appended to the output. I would like to see something like: sprintfn or sprintf-n or sprintf-nl |
From @lizmatJust curious, but what is wrong with "say fmt()" ?
|
The RT System itself - Status changed from 'new' to 'open' |
From @tbrowderOn Sun, Sep 11, 2016 at 3:54 PM, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
Liz, one reason, i'm ashamed to say, is lack of familiarity with fmt() |
From @zoffixznetOn Sun Sep 11 13:48:04 2016, tbrowder wrote:
I'd prefer to avoid adding two new subs and two new methods for the sake of saving a single character of typing. Since you're writing the format already sticking a \n into it isn't that difficult. |
From @tbrowderOn Sun, Sep 11, 2016 at 5:08 PM, Zoffix Znet via RT
Uh, say "what?" :) |
From @zoffixznetOn Sun Sep 11 15:29:45 2016, tbrowder wrote:
I don't think that works as a justification. The put() is used much more frequently than printf(), so it makes sense to have it as a "\n"-adding alternative to print(). put self.meow; printfn "%s", self.meow; You literally save 1 character of typing in a not the most used subroutine, all for the price of 4 extra routines for developers to maintain and document and for users to remember and debug when they miss the `n` at the end of the sub name. |
From @tbrowderOn Sunday, September 11, 2016, Zoffix Znet via RT <
Just a little humour. Someone thought thought it was worth it to not have ... I don't think that works as a justification. The put() is used much more
...
I respectfully disagree, Zoffix. I used printf in Perl 5, to a file, for In addition, such a function would reduce code line noise quite a bit IMHO. Anyway, if we ever get printf for an IO::Handle, I would like to see |
From @tbrowderOn Sun, Sep 11, 2016 at 6:49 PM, Zoffix Znet via RT
I would give up the fmt() routine if necessary to avoid extra maintenance. |
From @cokeOn Sun Sep 11 13:48:04 2016, tbrowder wrote:
-1 from me. -- |
From @moritzHi Tom, On Sun Sep 11 13:48:04 2016, tbrowder wrote:
I don't like it. Those names don't speak very well for themselves. If you don't like to reach for your backslash key, say sprintf "..." is also an option. Cheers, |
@moritz - Status changed from 'open' to 'rejected' |
From @tbrowderOn Mon Sep 12 07:39:56 2016, moritz wrote:
Moritz, that's fine for sprintf, but it doesn't help printf if it ever gets to be a method of IO::Handle. |
From @tbrowderOn Sun, Sep 11, 2016 at 3:54 PM, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
Liz, one reason, i'm ashamed to say, is lack of familiarity with fmt() |
Migrated from rt.perl.org#129252 (status was 'rejected')
Searchable as RT129252$
The text was updated successfully, but these errors were encountered: