From: Stefano Crocco Date: 2008-07-10T19:57:04+09:00 Subject: Re: Overloading the []-Operator On Thursday 10 July 2008, Matthias Winkelmann wrote: > Hi, > > I'm trying to overload the [ ] operator. It works fine for read-only > access: > > def [](acc) > @myValues[acc] > end > > However, I'd also need write access. I've tried: > > def [](acc)=(value) > @myValues[acc] = value > end > > And get a syntax error on the first line. I'd appreciate any help. > > Matt def []=(acc, value) Stefano