2011.01.30
■[Ruby] Range#step.to_a と * のメモ
arr = *(1..10).step(3) # => [1, 4, 7, 10] arr = (1..10).step(3).to_a # => [1, 4, 7, 10] (1..10).step(3).to_a # => [1, 4, 7, 10] *(1..10).step(3) # => # ~> -:4: syntax error, unexpected ')', expecting tCOLON2 or '[' or '.' # ~> ...(1..10).step(3) );$stderr.puts("!XMP1296330364... # ~> ... ^ # ~> -:8: syntax error, unexpected $end, expecting ')'
