From: Gregory Brown Date: 2007-08-03T01:46:40+09:00 Subject: Re: Dynamic method call On 8/2/07, James Edward Gray II wrote: > On Aug 2, 2007, at 2:27 AM, Andrea Maschio wrote: > > > Ok, Gregory, now i understand that i didn't explain very well. The > > only part > > in wich the user (let's say a VERY junior programmer) is the scripting > > interface i provide for him, so he will write > > if_is_true(a_condition, "do_something(arg1,arg2)") > > > > tha internal implementation is my matter, but if you think eval is > > bad (i > > probably understand why), the solution with > > > > send(:method,arg1,arg2) > > > > is probably good, but how can i allow a user to input the method > > name with > > his arguments? Anyway, i'm going to try. > > Have you considered: > > if_is_true(condition) { do_something(...) } > > ? > > That doesn't require eval() or send(). and do_something(..) if condition doesn't require anything. I'm still missing what value this if_is_true stuff is adding.