From: Wilson Bilkovich Date: 2006-03-22T23:10:10+09:00 Subject: Re: once again looking for my module methods Speaking of "<<", what about making more use of that piece of syntax? For example: class ConcreteThing << Module end I don't think that would be precisely "unifying" modules and classes. I feel pretty comfortable with Ruby these days, and I feel like my code is highly Ruby-like. On the other hand, I occasionally miss interfaces and abstract classes for readability reasons. On 3/21/06, Trans wrote: > > Thanks, David. I don't want to make > > > > include Math > > > > at the toplevel to add sin, cos, etc. to Object class. > > It already does. They are there you just can't access them b/c they're > private. > > Object.cos(1) > NoMethodError: undefined method `cos' for Object:Class > from (irb):1 > irb(main):002:0> include Math > => Object > irb(main):003:0> Object.cos(1) > NoMethodError: private method `cos' called for Object:Class > from (irb):3 > irb(main):004:0> class << Object > irb(main):005:1> public :cos > irb(main):006:1> end > => # > irb(main):007:0> Object.cos(1) > => 0.54030230586814 > > T. > > >