[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: * operator, Float
From:       Ken Bloom <kbloom () gmail ! com>
Date:       2010-07-25 20:08:24
Message-ID: pan.2010.07.25.19.09.32 () gmail ! com
[Download RAW message or body]

On Mon, 26 Jul 2010 02:05:48 +0900, Иван Сташко wrote:

> Where is the * operator defined for Float?

use instance_methods, not methods

Float.instance_methods(false).grep("*")

> ree-1.8.7-2010.02 > 3.0.methods.grep "*"
>  => ["*"]
> ree-1.8.7-2010.02 > 3.0.class
>  => Float
> ree-1.8.7-2010.02 > Float.methods.grep "*"
>  => []
> ree-1.8.7-2010.02 > Float.superclass
>  => Numeric
> ree-1.8.7-2010.02 > Numeric.methods.grep "*"
>  => []
> ree-1.8.7-2010.02 > Numeric.superclass
>  => Object
> ree-1.8.7-2010.02 > Object.methods.grep "*"
>  => []
> ree-1.8.7-2010.02 > Object.superclass
>  => nil
> 
> I'm guessing there's a mixin somewhere or this has to do with
> eigenclasses or perhaps a C-module has been mixed-in between Numeric and
> Float.  Where do I look at this code?





-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic