[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby.h missing rb_cMethod?

gga

7/11/2006 3:46:00 AM

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?

12 Answers

Jan Friedrich

7/11/2006 10:50:00 AM

0

gga wrote:
> 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

Yukihiro Matsumoto

7/11/2006 11:19:00 AM

0

Hi,

In message "Re: ruby.h missing rb_cMethod?"
on Tue, 11 Jul 2006 19:55:05 +0900, Jan Friedrich <spamgrav@web.de> writes:

|> 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.

Christian Neukirchen

7/11/2006 8:38:00 PM

0

Yukihiro Matsumoto <matz@ruby-lang.org> writes:

> Hi,
>
> In message "Re: ruby.h missing rb_cMethod?"
> on Tue, 11 Jul 2006 19:55:05 +0900, Jan Friedrich <spamgrav@web.de> writes:
>
> |> 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.

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

> matz.
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneuk...

Yukihiro Matsumoto

7/11/2006 11:54:00 PM

0

Hi,

In message "Re: ruby.h missing rb_cMethod?"
on Wed, 12 Jul 2006 05:37:54 +0900, Christian Neukirchen <chneukirchen@gmail.com> writes:

|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

Hmm. Does this behavior makes methods second-class?

matz.

dblack

7/12/2006 12:01:00 AM

0

Yukihiro Matsumoto

7/12/2006 12:15:00 AM

0

Hi,

In message "Re: ruby.h missing rb_cMethod?"
on Wed, 12 Jul 2006 09:00:46 +0900, dblack@wobblini.net writes:

|> |irb(main):003:0> method(:nil?).object_id
|> |=> 1758564
|> |irb(main):004:0> method(:nil?).object_id
|> |=> 1746454
|>
|> Hmm. Does this behavior makes methods second-class?
|
|1.5'th class, anyway :-)

Then strings are 1.5'th class too.

2.times {
p "foobar".object_id
}

matz.

dblack

7/12/2006 10:14:00 AM

0

Joel VanderWerf

7/12/2006 8:26:00 PM

0

dblack@wobblini.net wrote:
> Hi --
>
> On Wed, 12 Jul 2006, Yukihiro Matsumoto wrote:
>
>> Hi,
>>
>> In message "Re: ruby.h missing rb_cMethod?"
>> on Wed, 12 Jul 2006 09:00:46 +0900, dblack@wobblini.net writes:
>>
>> |> |irb(main):003:0> method(:nil?).object_id
>> |> |=> 1758564
>> |> |irb(main):004:0> method(:nil?).object_id
>> |> |=> 1746454
>> |>
>> |> Hmm. Does this behavior makes methods second-class?
>> |
>> |1.5'th class, anyway :-)
>>
>> Then strings are 1.5'th class too.
>>
>> 2.times {
>> p "foobar".object_id
>> }
>
> But "" is a literal constructor; you're instantiating String twice.
> nil? is a method that already exists -- so it's more comparable to:
>
> s = "I already exist."
> 2.times { p s.object_id }

There's a difference between the object itself and how you got the object.

irb(main):001:0> String.name.object_id
=> 23076870
irb(main):002:0> String.name.object_id
=> 23073030

Strings are certainly first class. It's something about how you get the
name of a class (or, analogously, a method instance) that makes it feel
1.5 class. Would you say that class names are not first-class objects?

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

dblack

7/12/2006 8:34:00 PM

0

Rob Biedenharn

7/12/2006 8:40:00 PM

0