Re: [MacRuby-devel] assign value to identifier in runtime with objc codes

2009-07-27 Thread Linan Wang
Got it. thanks! On Mon, Jul 27, 2009 at 7:50 PM, Laurent Sansonetti wrote: > Hi Linan, > You can evaluate "self" for that. > > id ruby_self = [[MacRuby sharedRuntime] evaluateString:@"self"]; > > Laurent > > On Jul 27, 2009, at 1:52 AM, Linan Wang wrote: > > Hi Laurent,Thanks for the explanation.

Re: [MacRuby-devel] assign value to identifier in runtime with objc codes

2009-07-27 Thread Laurent Sansonetti
Hi Linan, You can evaluate "self" for that. id ruby_self = [[MacRuby sharedRuntime] evaluateString:@"self"]; Laurent On Jul 27, 2009, at 1:52 AM, Linan Wang wrote: Hi Laurent, Thanks for the explanation. A related question: how to get the "main/self" object of the macruby runtime? On Mon

Re: [MacRuby-devel] assign value to identifier in runtime with objc codes

2009-07-27 Thread Linan Wang
Hi Laurent,Thanks for the explanation. A related question: how to get the "main/self" object of the macruby runtime? On Mon, Jul 27, 2009 at 6:50 AM, Laurent Sansonetti wrote: > Hi Linan, > > You can't really assign a Ruby local variable from Objective-C, since Ruby > locals are generally scoped

Re: [MacRuby-devel] assign value to identifier in runtime with objc codes

2009-07-26 Thread Laurent Sansonetti
Hi Linan, You can't really assign a Ruby local variable from Objective-C, since Ruby locals are generally scoped around a particular method, but you can assign to an instance variable of a given object, a constant, a global variable (or eventually a class variable, but this is evil, don't

[MacRuby-devel] assign value to identifier in runtime with objc codes

2009-07-26 Thread Linan Wang
Hi everybody,I'm trying to migrate from FScript to MacRuby. The problem I'm facing now is how to assign values to variables in the macruby runtime with objc codes. In Fscript framework, it's fairly straightforward: setObject:forIdentifier call of FSInterpreter. I've tried rb_define_varible but it d