[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

nicolas.pouillard

3/10/2006 9:37:00 AM

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,

--
Nicolas Pouillard aka Ertai <ertai@feydakins.org>
http:... Uttk -- Unified Test Tool Kit