matz / ruby-lang.org (Yukihiro Matsumoto) wrote in message news:<7ri47.36217$yb3.1516747 / e420r-atl1.usenetserver.com>... > Hi, > Use pointer to the variable, i.e. > > static VALUE > rorbit_trap_exception(VALUE* error_holder, VALUE error) > { > if (!RTEST(rb_obj_is_kind_of(error, rb_eStandardError))) > *error_holder = rb_exc_new2(rb_eTypeError, "not an exception"); > else > *error_holder = error; > return Qnil; > } > > .. > > VALUE packed_args = rb_ary_new3(3, servant->impl, ID2SYM(rb_intern(name)), args); > results = rb_rescue(rorbit_apply_try, packed_args, rorbit_trap_exception, (VALUE)&error); > That was my first thought, until I saw that the fourth argument to rb_rescue had to be a VALUE. You're saying it's OK to coerce a VALUE * to a VALUE? I know any pointer can fit into a VALUE, but isn't this somewhat confusing programming style? (Not to mention even more spurious compiler warnings :-) Is this done habitually in the Ruby source?