Actions
Feature #15919
closedOffset parameter for `Integer#times`
Feature #15919:
Offset parameter for `Integer#times`
Actions
Added by sawa (Tsuyoshi Sawada) over 7 years ago. Updated about 7 years ago.
Could be confusing. "5 times 3" is 15.
It took me a moment to understand the proposal (I am not sure why I am having a hard time understanding
proposals lately; but in my defence, I am getting older, and it is currently very hot in central europe -
hope you folks have a better time with the weather).
So to the proposal - actually I sort of agree with sawa that there may be use cases for it. Or at the
least I can imagine that this may be the case.
I also think that Matthew's comment makes sense; people can misread "5 times 3" as "5 x 3" (I deliberately
omitted the () and . there.
How about some hash-parameter instead? Like:
Or some other parameter, perhaps just start: or something like that.
Although I should also point out that this would be different to what sawa suggested, so since
it is his proposal, the focus should be on his initial suggestion primarily, not the deviation;
I was just trying to integrate what Matthew commented on.
I am fine either way and I am fine with the current behaviour, too - I really am neutral mostly
in regards to this issue. :)
I agree with all the commenters that using keyword arguments is crucial (and I prefer start_at: (or maybe just start:) to offset:). I also agree that Integer#step seems already good enough. Maybe we could add a line about Integer#step in the documentation of Integer#times.
It seems difficult to introduce (Integer#step)...
Matz, what do you think about it?
I think Numeric#step was OK. Is there any reason to stick with Integer#times?
Matz.