How to produce from C, a ruby symbol?

i’d like to use ruby symbols from C , i’ve found ID2SYM and SYM2ID but
nothing like STR2SYM in ruby.h

i’d like to produce those ruby symbols :

:verbose and : noop

from C side…

i’m able to retrieve, from C side, the value of a key provided i know,
in advance the key and the key is a string…

Yvon

On 8/17/07, unbewust [email protected] wrote:

i’d like to use ruby symbols from C , i’ve found ID2SYM and SYM2ID but
nothing like STR2SYM in ruby.h

i’d like to produce those ruby symbols :

:verbose and : noop

ID2SYM( rb_intern( “verbose” ) );
ID2SYM( rb_intern( “noop” ) );

Blessings,
TwP

On 17 août, 16:55, “Tim P.” [email protected] wrote:
oop

ID2SYM( rb_intern( “verbose” ) );
ID2SYM( rb_intern( “noop” ) );

fine thanks a lot !

Yvon

unbewust wrote:

i’d like to use ruby symbols from C , i’ve found ID2SYM and SYM2ID but
nothing like STR2SYM in ruby.h

rb_intern()

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs