def = (n)
    @f = n   if n.type==String

  end 

C:/1134re.rb:20: syntax error
  def = (n)
       ^
C:/1134re.rb:20: warning: don't put space before argument parentheses
C:/1134re.rb:207: syntax error

sorry this is my first class


On Wed, 24 Nov 2004 11:56:48 +0900, Gavin Kistner <gavin / refinery.com> wrote:
> On Nov 23, 2004, at 7:15 PM, ruby talk wrote:
> > How can i over ride [] in a class?
> 
> class Foo
>         def []( n )
>                 #...
>         end
> end
> 
>