ruby.h missing rb_cMethod?

G

gga

It seems to me ruby.h (1.8.4) is missing the exporting of rb_cMethod,
with a line similar to:

RUBY_EXTERN VALUE rb_cMethod;

Is this by design?
 
J

Jan Friedrich

gga said:
It seems to me ruby.h (1.8.4) is missing the exporting of rb_cMethod,
with a line similar to:

RUBY_EXTERN VALUE rb_cMethod;

Is this by design?
Yes. Ruby has no first class methods therefore it doesn't exist a class
Method.

regards,
Jan
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: ruby.h missing rb_cMethod?"

|> RUBY_EXTERN VALUE rb_cMethod;
|>
|> Is this by design?

|Yes. Ruby has no first class methods therefore it doesn't exist a class
|Method.

Pardon me?

Ruby has first class methods, therefore it does have class Method.
It's just matter of implementation. I thought no one would require
access to the rb_cMethod. I will add it later.

matz.
 
R

Ryan Davis

Ruby has first-class Method instances, but methods aren't first
class, no?

irb(main):003:0> method:)nil?).object_id
=> 1758564
irb(main):004:0> method:)nil?).object_id
=> 1746454

I think it is fair to say that Methods are first class, but ruby has
no first class Method dictionaries. I would LOVE to have real method
dicts like Smalltalk.

:method returns a copy of the method requested, but it is first class
just the same. From c2.com:

"A language construct is said to be a FirstClass value in that
language when there are no restrictions on how it can be created and
used: when the construct can be treated as a value without
restrictions."

I think methods in ruby fit that (for the most part).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,209
Messages
2,571,085
Members
47,683
Latest member
AustinFairchild

Latest Threads

Top