From: Smart RoR on
Gary Wright wrote:
> On Mar 23, 2010, at 12:05 AM, Smart RoR wrote:
>> Every operator is a method in ruby....
>>
>> like 1 - 1 = 0 here - is a method.
>>
>> That is my understanding....
>
> Let me try again. The '<' in a class definition
> is not an operator and so doesn't have an
> associated method. It looks like an operator
> but is not parsed or interpreted as an operator
> when used in a class definition.
>
> Gary Wright


Thanks. But in that case where is the < handled to identify
inheritance....
That is the core handling as to where is this implemented in ruby core.

--
Posted via http://www.ruby-forum.com/.

From: Rob Biedenharn on

On Mar 23, 2010, at 7:46 AM, Smart RoR wrote:

> Gary Wright wrote:
>> On Mar 23, 2010, at 12:05 AM, Smart RoR wrote:
>>> Every operator is a method in ruby....
>>>
>>> like 1 - 1 = 0 here - is a method.
>>>
>>> That is my understanding....
>>
>> Let me try again. The '<' in a class definition
>> is not an operator and so doesn't have an
>> associated method. It looks like an operator
>> but is not parsed or interpreted as an operator
>> when used in a class definition.
>>
>> Gary Wright
>
>
> Thanks. But in that case where is the < handled to identify
> inheritance....
> That is the core handling as to where is this implemented in ruby
> core.
>
> --
> Posted via http://www.ruby-forum.com/.
>


That would be deep inside parse.y -- the grammar file for the parser.
Look for the superclass non-terminal (about 4100 lines or so into the
file).

-Rob

Rob Biedenharn http://agileconsultingllc.com
Rob(a)AgileConsultingLLC.com