From: gga Date: 2005-02-18T05:54:52+09:00 Subject: Re: SWIG: ruby proc->c function pointer I finally got around to trying this. Thanks. Unfortunately, the latest SWIG (v1.3.22) seems to choke on it, with: irb(main):005:0> Callback.invoke(Proc.new{|str| p str}, "abc") TypeError: cannot convert nil into String from (irb):5:in `invoke' from (irb):5 Looking at the code, SWIG fails in the StringValuePtr() conversion here. /* Get type mangle from class name */ SWIGRUNTIME(char *) SWIG_Ruby_MangleStr(VALUE obj) { VALUE stype = rb_iv_get(obj, "__swigtype__"); return StringValuePtr(stype); }