go-mruby icon indicating copy to clipboard operation
go-mruby copied to clipboard

How can I get `Hash` value via a `Symbol` key?

Open zhuangsirui opened this issue 8 years ago • 1 comments

I read the doc, use Hash.Get to access values, but I can't find a way to convert to Symbol.

zhuangsirui avatar Jul 03 '17 02:07 zhuangsirui

Hi!

So I don't think the library has support for this yet, but I don't think it'll be complicated to add; basically we need a new value type called Symbol that MrbValue()'s with C.mrb_intern_cstr. This should yield the values necessary to populate the hash table, or use symbols in any other context.

It might take me a few weeks to free up time but i can do this patch soon.

erikh avatar Jul 04 '17 04:07 erikh