code? rb_ext?

3 views
Skip to first unread message

rogerdpack

unread,
Oct 7, 2009, 4:57:42 PM10/7/09
to rubinius-dev
Question.

Does rubinius provide a way for one to retrieve the source of a
method? That would be nice. I suppose at least a #source_location
would suffice.

Also, does rubinius provide the exact same ruby c api? like rb_iterate
et al?

Thanks!
-r

Evan Phoenix

unread,
Oct 7, 2009, 5:42:34 PM10/7/09
to rubinius-dev

On Oct 7, 1:57 pm, rogerdpack <rogerpack2...@gmail.com> wrote:
> Question.
>
> Does rubinius provide a way for one to retrieve the source of a
> method?  That would be nice.  I suppose at least a #source_location
> would suffice.

We've got all that information available, not sure it's all wired up
nicely to methods. We threw up Method#location, which returns "file,
near line 1" with file and 1 filled in properly.

>
> Also, does rubinius provide the exact same ruby c api? like rb_iterate
> et al?

Thats the general idea. We add functions are extensions need them.


- Evan

>
> Thanks!
> -r

rogerdpack

unread,
Oct 8, 2009, 3:25:01 PM10/8/09
to rubinius-dev
> We've got all that information available, not sure it's all wired up
> nicely to methods. We threw up Method#location, which returns "file,
> near line 1" with file and 1 filled in properly.

Nice. Might be good to try and adopt the #source_location style of
1.9 I suppose.
-r

Dirkjan Bussink

unread,
Oct 8, 2009, 4:25:51 PM10/8/09
to rubini...@googlegroups.com

On 8 Oct 2009, at 21:25, rogerdpack wrote:

> Nice. Might be good to try and adopt the #source_location style of
> 1.9 I suppose.

I've changed the available Method#location to Method#source_location
and made it behave like on 1.9.

The general idea is that we can adhere to how 1.9 handles something
like this, if it exposes data that is already available and not
represents some deep 1.9 internals.

--
Regards,

Dirkjan Bussink

rogerdpack

unread,
Nov 16, 2009, 11:54:00 AM11/16/09
to rubinius-dev
> > Also, does rubinius provide the exact same ruby c api? like rb_iterate
> > et al?
>
> Thats the general idea. We add functions are extensions need them.

Kind of a joke but here's all I need :) (most of these are referenced
from http://github.com/rdp/crystalizer which is built off
http://github.com/githubsvnclone/ruby2cext, a 1.8 -> C converted.
I'm not actually requesting these (though see a later post where I'll
mention them).

-r

rb_yield_splat rb_str_new rb_ivar_get rb_e rb_equal rb_global_entry
rb_define_protected_method rb_warn rb_define_module_function
rb_str_substr rb_define_class_id rb_ary_clear rb_const_set
rb_alias_variable rb_ary_to_s rb_cvar_defined rb_error_frozen
rb_range_new rb_ensure rb_if_known_clean rb_file rb_str_concat
rb_require_safe rb_file_to_toplevel_functions rb_trap_immediate
rb_ary_push rb_str_dump rb_define_ rb_reg_search rb_eql rb_class_real
rb_reg_match_post rb_funcall rb_define rb_block_given_p rb_f_
rb_ary_subseq rb_obj_is_proc rb_ary_pop rb_undef rb_float_new
rb_cvar_set rb_autoload_p rb_fix rb_gvar_get rb_error rb_ary_plus
rb_const_get_from rb_ary_store rb_hash_new rb_obj_as_string
rb_ary_delete_at rb_str_append rb_ary_shift rb_raise rb_obj_is_kind_of
rb_reg_match rb_str_aset rb_str_to_inum rb_obj_class rb_str_inspect
rb_dbl rb_alias rb_check_convert_type rb_call_super
rb_define_private_method rb_id rb_reg_match_pre rb_hash_aset
rb_ary_concat rb_const_defined_at rb_ivar_set rb_str_aref rb_to_id
rb_hash_aref rb_global_variable rb_check_array_type rb_hash_delete
rb_ary_to_ary rb_ary_cmp rb_reg_new rb_const_defined rb_block_proc
rb_set_class_path rb_const_defined_from rb_mem_clear rb_ary_reverse
rb_cstr_to_inum rb_ary_entry rb_ivar_defined
rb_define_singleton_method
rb_autoload_load rb_ary_join rb_reg_match_last rb_str_cmp
rb_const_get_at rb_big rb_yield rb_safe_level rb_gc_mark
rb_define_module_id rb_iter_break rb_afterward rb_obj_classname
rb_ary_aref rb_obj_id rb_memcmp rb_ary_unshift rb_ary_includes
rb_const_get rb_intern rb_reg_nth_defined rb_singleton_class
rb_backref_get rb_gvar_defined rb_gvar_set rb_cvar_get rb_node_newnode
rb_reg_nth_match rb_str_intern rb_obj_is_instance_of rb_jump_tag
rb_ary_new rb_ary_dup rb_iterate rb_rescue rb_define_method
rb_class_inherited rb_reg_last_match rb_c

Evan Phoenix

unread,
Nov 16, 2009, 11:59:45 AM11/16/09
to rubini...@googlegroups.com

On Nov 16, 2009, at 8:54 AM, rogerdpack wrote:

>
>>> Also, does rubinius provide the exact same ruby c api? like rb_iterate
>>> et al?
>>
>> Thats the general idea. We add functions are extensions need them.
>
> Kind of a joke but here's all I need :) (most of these are referenced
> from http://github.com/rdp/crystalizer which is built off
> http://github.com/githubsvnclone/ruby2cext, a 1.8 -> C converted.
> I'm not actually requesting these (though see a later post where I'll
> mention them).

Please file tickets on any missing capi functions you find and need.

- Evan
Reply all
Reply to author
Forward
0 new messages