On 8/1/07, Andrea Maschio <andrea.maschio / gmail.com> wrote:
> the problem is that method_name is a static call, i need to make it dynamic
> and choosed by the user/programmer, so at least he should type
> eval("method_name(arg1,arg2)") if condition
>
> but my aim was just to encapsulate this in a more comprehensible grammar
> like
>
> if_it_happens_that(is_true, "do_something(arg1,arg2)")
>
> in another language that english it sound more different using english word
> "like if, then, end, do"
>
> i know it could sound weird, but this was my need, and i solved it with eval
> (of course the internal logic is far more complex)

I still don't quite understand the problem you're tring to solve, but
consider using send(:method,arg1,arg2) instead of eval().  You're
begging for a mess using eval() to allow end users to input stuff.