Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Daniel Berger wrote:
> }> ID id_split = rb_intern("split");> }> What am I doing wrong here?>> Thanks,>> Dan>> PS - Yes, I realize I'm not doing error handling in the C extension -> I'm not worried about that for now.
You should ;-) the (null) stuff is a sign that you're using a NULL
pointer somewhere, though I can't get where. The segfault is another
indication. So one thing here is returning false or NULL...
The problem, in my opinion, is here:
RBASIC(v_result)->klass
Why do you need to use ->klass ?? All objects you're getting *are*
classes or modules already. You end up looking for constants in the
Class class, and that is not where they are defined.
Cheers,
Vince

On 2/13/07, Daniel Berger <djberg96@gmail.com> wrote:
> I found this snippet posted to handle doing const_get for nested> classes/modules:
<snip>
I know this doesn't directly answer the question you asked, but why
not just use rb_path2class()?

On Feb 13, 2007, at 14:40, Lyle Johnson wrote:
> On 2/13/07, Daniel Berger <djberg96@gmail.com> wrote:>>> I found this snippet posted to handle doing const_get for nested>> classes/modules:>> <snip>>> I know this doesn't directly answer the question you asked, but why> not just use rb_path2class()?
One of these days I'm going to write a patch to expose this to Ruby :P

On Feb 14, 12:50 pm, "Lyle Johnson" <lyle.john...@gmail.com> wrote:
> On 2/14/07, Eric Hodel <drbr...@segment7.net> wrote:>> > One of these days I'm going to write a patch to expose this to Ruby :P>> Expose what to Ruby?
I think he just means that there's no direct equivalent in plain Ruby
(right?).
I think just patching const_get to handle "::" would suffice.
Dan

On Feb 14, 2007, at 12:05, Daniel Berger wrote:
> On Feb 14, 12:50 pm, "Lyle Johnson" <lyle.john...@gmail.com> wrote:>> On 2/14/07, Eric Hodel <drbr...@segment7.net> wrote:>>>>> One of these days I'm going to write a patch to expose this to>>> Ruby :P>>>> Expose what to Ruby?>> I think he just means that there's no direct equivalent in plain Ruby> (right?).
Yup. I've reimplemented rb_path2class() numerous times in ruby, and
there's a perfectly good C method lying around that needs only a one-
line patch to be accessible.
> I think just patching const_get to handle "::" would suffice.
Possibly.

On Feb 14, 1:44 pm, Eric Hodel <drbr...@segment7.net> wrote:
> > I think he just means that there's no direct equivalent in plain Ruby> > (right?).>> Yup. I've reimplemented rb_path2class() numerous times in ruby, and> there's a perfectly good C method lying around that needs only a one-> line patch to be accessible.>> > I think just patching const_get to handle "::" would suffice.>> Possibly.
I tried messing with object.c yesterday, but I couldn't make it work.
Any ideas for a patch? It would be nice to get one in for 1.8.6 if
possible.
Dan