Hi All,
Running the following on Sonic PI 3.2.2 (Windows 10):
puts (ring 1, 2, 3, 4, 5, 6, 7).take_last(2)
Fails with error:
Runtime Error: [workspace_seven] - TypeError
Thread death!
no implicit conversion from nil to integer
C:/apps/sonic-pi/Sonic Pi Portable/App/Sonic Pi/app/server/ruby/core.rb:557:in `[]'
C:/apps/sonic-pi/Sonic Pi Portable/App/Sonic Pi/app/server/ruby/core.rb:557:in `[]'
C:/apps/sonic-pi/Sonic Pi Portable/App/Sonic Pi/app/server/ruby/core.rb:803:in `take_last'
workspace_seven:in `block (2 levels) in __spider_eval'
C:/apps/sonic-pi/Sonic Pi Portable/App/Sonic Pi/app/server/ruby/lib/sonicpi/runtime.rb:781:in `eval'
C:/apps/sonic-pi/Sonic Pi Portable/App/Sonic Pi/app/server/ruby/lib/sonicpi/runtime.rb:781:in `block (2 levels) in __spider_eval'
C:/apps/sonic-pi/Sonic Pi Portable/App/Sonic Pi/app/server/ruby/lib/sonicpi/runtime.rb:1042:in `block (2 levels) in __in_thread'
I tried similar code replacing take_last with drop_last, and it worked as expected. So is this a bug in take_last?
I just discovered Sonic Pi a few days back, so I may be missing something obvious.
Thanks in advance,
Ceredig