2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

mrb_value型の変数を簡単に表示する方法

Posted at

なるべくmrubyに処理をお願いしたいケースでは、mrb_value型で
保持している方が何かと便利だが、printfで気軽に表示できないなぁ
と思っていたが、mrb_funcallで「p」を実行すれば、

rubyだと

p obj

を実行したことになり、自分の目的はこれで果たせた。

mrb_value obj

// ‥ なんらかの処理でobjに値が入る

mrb_funcall(mrb,mrb_top_self(mrb), "p", 1, obj);
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?