From: Robert Klemme Date: 2005-05-05T01:45:03+09:00 Subject: Re: Bug or on purpose? "Joe Van Dyk" schrieb im Newsbeitrag news:c715e640505040933dc1a4a9@mail.gmail.com... > On 5/4/05, David A. Black wrote: >> Hi -- >> >> On Thu, 5 May 2005, Joe Van Dyk wrote: >> >> > Can someone fill me in on what's going on here? >> > >> > It looks like the code reads something like: >> > >> > def opa(s) >> > 'z' >> > end >> > >> > So, >> > opa('kct') >> > should return 'z'. >> > >> > But I have no idea what >> > opa = opa('kct') >> > is trying to do. >> >> It's trying to set a local variable called opa to the result of >> calling (the method) opa with arg 'kct'. > > Isn't that illegal? The name 'opa' has already been defined. IMHO that's perfectly ok as long as all uses are non ambiguous. > /me pulls out copy of ISO Ruby standard. > > /me notices that it's missing. :( /me too But that's also ok and fits well with Ruby's dynamic nature. Hint: no static typing, no ISO spec. ;-) Kind regards robert