As what Kernel::format(format_string, *arguments) is populating the
format string with the data provided by *arguments, isn't it natural
for a String object (namely the format_string) to receive the
'populate' message with the data?
Maybe String.populate_with is better in terms of grammar correctness,
but I thing populate is fine.
A bones question, if you once was a Java developer, do you still
remember Java's version of sprintf? Maybe this help make more sense of
String.populate()
On Wed, Dec 15, 2010 at 1:22 PM, redstun <redstun@gmail.com> wrote:
This idea came up in my mind last night.
As what Kernel::format(format_string, *arguments) ^ is populating the
format string with the data provided by *arguments, isn't it natural
for a String object (namely the format_string) to receive the
'populate' message with the data?
Maybe String.populate_with is better in terms of grammar correctness,
but I thing populate is fine.
A bones* question, if you once was a Java developer, do you still
remember Java's version of sprintf? Maybe this help make more sense of
String.populate()
On Wed, Dec 15, 2010 at 1:22 PM, redstun <redstun@gmail.com> wrote:
As what Kernel::format(format_string, *arguments) is populating the
format string with the data provided by *arguments, isn't it natural
for a String object (namely the format_string) to receive the
'populate' message with the data?
I mean to have String.populate as an instance method
i.e.
fmt_str = 'aligned numbers: %6d %6d"
result = fmt_str.populate(1, 2)
Nothing wrong, just to make things look more natural
···
On Wed, Dec 15, 2010 at 1:36 PM, botp <botpena@gmail.com> wrote:
On Wed, Dec 15, 2010 at 1:22 PM, redstun <redstun@gmail.com> wrote:
> As what Kernel::format(format_string, *arguments) is populating the
> format string with the data provided by *arguments, isn't it natural
> for a String object (namely the format_string) to receive the
> 'populate' message with the data?