Strange argument error in Ruby 1.8.4 (2006-02-24)

N

nicolas.pouillard

Hi there,

I found a strange difference somewhere between Ruby 1.8.4 (2005-12-24)
and Ruby 1.8.4 (2006-02-24).

Here the code:

h = {}
a = []
h['test'] ||= a.join 'c'

ArgumentError: wrong number of arguments (2 for 1)
from (irb):5:in `[]'
from (irb):5


To fix it, I add parenthesis like that:

h['test'] ||= a.join('c')

But I found it strange enough to ask the question.

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,049
Members
48,769
Latest member
Clifft

Latest Threads

Top