[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Balasan: Re: Embedding 1.9

Edwin Pratomo

1/9/2008 10:17:00 AM


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

> Hi,
>
> In message "Re: Embedding 1.9"
> on Wed, 9 Jan 2008 18:45:44 +0900, Edwin Pratomo <edwin@imt.co.id>
> writes:
>
> |while it's still hot talking about embedding, let me ask a related question
> |here: is there any way to do reflection from ruby C API?
>
> What kind of reflection? You can define classes, inspect variables,
> etc. from C.

in particular, what I would like to do is Object.private_methods, in C way.

rgds,
Edwin.




________________________________________________________
Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers....

1 Answer

Dave Thomas

1/9/2008 1:54:00 PM

0


On Jan 9, 2008, at 4:17 AM, Edwin Pratomo wrote:

> in particular, what I would like to do is Object.private_methods, in
> C way.

To call a method that's available in RUby, just use rb_funcall

rb_funcall(receiver, mid, argc, arg, arg, ...)

The mid parameter is the ID of the method to invoke (nor its name) and
the arguments (if any) are VALUEs,



Dave