From: Ronald Fischer Date: 2007-06-25T23:40:42+09:00 Subject: Syntax error with array interpolation Below is a code snippet which gives me some headache: def headache yield(*(foo(1)),"bar") end def foo(n) [n,n+2,n+5] end headache { |a,b,c,d| puts a.to_s; puts b.to_s; puts c.to_s; puts d } I had expected that this would print 1 3 6 bar But Ruby 1.8.5 complains: ./headache.rb: line 1: def: command not found ./headache.rb: line 2: syntax error near unexpected token `*' '/headache.rb: line 2: ` yield(*(foo(1)),"bar") and Ruby 1.8.6 complains: H:/tmp/headache.rb:2: syntax error, unexpected tSTRING_BEG, expecting tAMPER yield(*(foo(1)),"bar") ^ H:/tmp/headache.rb:2: syntax error, unexpected ')', expecting kEND H:/tmp/headache.rb:10: syntax error, unexpected $end, expecting kEND There must something be wrong with the way I'm doing array interpolation, but I can't spot the error.... Ronald -- Ronald Fischer Phone: +49-89-452133-162