From: nobu.nokada@... Date: 2002-08-27T11:33:41+09:00 Subject: Re: Question about Ruby extension API Hi, At Tue, 27 Aug 2002 11:19:21 +0900, nobu.nokada@softhome.net wrote: > At Tue, 27 Aug 2002 06:45:04 +0900, > Bennett, Patrick wrote: > > I've looked all over but can't find the function call for > > doing a simple assignment (!) > > rb_gv_set() for global variables, > rb_iv_set() for instance variables, > rb_cv_set() for class variables. I forgot rb_lastline_set() and rb_backref_set() for $_ and $~, respectively. > > Within a method (set via rb_define_method and later called by > > the user), I would like to do the equivalent of: > > obj = otherobj.method > > I tried calling rb_intern on "=", and using rb_funcall( obj, > > (IdFromRBIntern), 1, (value from call of other method) ) but > > I get an 'undefined method' error from ruby at runtime. > > Assignment is not a method. Of cource, you can use attr_writer, such as "foo=". rb_funcall(obj, rb_intern("foo="), 1, value); -- Nobu Nakada