On Mon, Apr 21, 2003 at 11:23:54PM +0900, ts wrote:
> >>>>> "P" == Paul Brannan <pbrannan / atdesk.com> writes:
> P> Why does module_function() make foo() private?
> 
>  Perhaps to use it like this
> 
> pigeon% ruby -e 'p Math.sin(0)'
> 0.0
> 
> pigeon% ruby -e 'include Math; p sin(0)'
> 0.0

Making it private doesn't help there; it still works if it is public:

irb(main):001:0> module Math
irb(main):002:1>   public :sin
irb(main):003:1> end
=> Math
irb(main):004:0> include Math
=> Object
irb(main):005:0> Math.sin(0)
=> 0.0
irb(main):006:0> sin(0)
=> 0.0

Paul