Project

General

Profile

Actions

Feature #10214

closed

new functions for compare of symbols in C API

Added by Hanmac (Hans Mackowiak) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:64841]

Description

currently i often use Symbols as enums in my bindings,
have something like this with comparing symbols by their ID

if(SYMBOL_P(sym))
{
  if(rb_intern("name") == SYM2ID(sym))
    return ENUM_NAME;
}

now with dynamic symbols and other ones, its problematic because with that i always foce a dynamic symbol to become static or pinned (that what SYM2ID does)

so imo there need to be better ways to compare is an ID and a VALUE-sym or two VALUE-syms and check if they have the same content (hm because comparing two VALUE with == might/does not work)

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0