P
Peña, Botp
Hi,
1. I am a Integer#times fan So you see my (and my kids) nuby codes
littered w it. I have a small request though.
Can we pass initial and step params?
ie
from int.times {|i| block }
to int.times(starting=0, step=1) {|i| block }
I hope this would not break old code, right?
2. my request may be handled by step. But I do not like step (me only);
maybe because the sound does not ring or maybe because I do not like the
order of params when read.
iow
from num.step(limit, step ) {|i| block },
I prefer fr_num.step(step, upto ) {|i| block }
since I would read the ff 1.step(2,5) {|x| p x} as
"from 1 step 2 up to 5" (I know this would break old code)
I feel Integer#upto has a better read -"int.upto(limit) {|i| block }", but
sadly #upto has no steps either
thanks for reading =)
kind regards -botp
1. I am a Integer#times fan So you see my (and my kids) nuby codes
littered w it. I have a small request though.
Can we pass initial and step params?
ie
from int.times {|i| block }
to int.times(starting=0, step=1) {|i| block }
I hope this would not break old code, right?
2. my request may be handled by step. But I do not like step (me only);
maybe because the sound does not ring or maybe because I do not like the
order of params when read.
iow
from num.step(limit, step ) {|i| block },
I prefer fr_num.step(step, upto ) {|i| block }
since I would read the ff 1.step(2,5) {|x| p x} as
"from 1 step 2 up to 5" (I know this would break old code)
I feel Integer#upto has a better read -"int.upto(limit) {|i| block }", but
sadly #upto has no steps either
thanks for reading =)
kind regards -botp