From: Ed Sinjiashvili Date: 2001-08-14T15:01:44+09:00 Subject: [ruby-talk:19678] Re: () overloading ts writes: > >>>>> "E" == Ed Sinjiashvili writes: > > E> ts writes: > >> >>>>> "E" == Ed Sinjiashvili writes: > >> > E> class Proc > E> def () (*args) > E> call(*args) > E> end > E> end > >> > >> Proc#call use () which call Proc#(), which call Proc#call which use () > >> which call Proc#(), etc ... :-))) > E> Proc#call is an instance of class Method - so it can not call Proc#() - > E> unless you somehow override Method#() to use it. > > I'll write it another way (just replace () with tt) > > class Proc > def tt *args > call tt *args > end > end I got the point. If we have () operator then it's evaluated in scope of Proc instance before going to call. Giving more thought to it, I can't think of any reasonable () overloading except in Proc class. And it's looks more like a syntactic sugar than a feature. There's no real need to make class callable since we got blocks which are first class functors. Thanx to everyone for helpful insights. -- Ed Sinjiashvili