Module in macruby has many methods that it doesn’t usually have. One of these is __type__ and I simply can’t seem to figure out what it does. What does it do?
Thanks!
z.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
__type__is defined in object.c as:which in turns depends on the
rb_typefunction:Definitely, it simply returns a number that corresponds to a type identifier, as defined by the pre compiler constants T_FIXNUM, T_FLOAT, etc.
I would say that it is something of really limited use for standard users, although it may make your code more efficient in type checking when you write C extensions.