From: Ruby Newbee Date: 2010-02-04T23:11:48+09:00 Subject: Re: hooking subscript operations in a hash On Thu, Feb 4, 2010 at 9:54 PM, Marnen Laibow-Koser wrote: > Ralph Shnelvar wrote: >> RN> Is env['X'] = 'Y' the same as env[]=('X','Y') ? >> RN> Since you defined a method with def []= so I think env[]=('X','Y') >> is >> RN> easier for understanding. >> >> First ... I think you meant >>   env[]={'X', 'Y'} >> (braces instead of parenthesis) > > But you are wrong.  It's just like any other method call: > object.method(args) > so > env.[]=('X', 'Y') > > But never do it this way.  env['X'] = 'Y' is far clearer. > Thanks. I lost the ".", yes it should be env.[]=(...) OK I got it that env['X']='Y' is better, thanks again.