LoginSignup
1

More than 5 years have passed since last update.

Organization

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

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

rubyだと

p obj

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

mrb_value obj

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

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

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
What you can do with signing up
1