The use of the various *eval*

Why are there so many different ways to eval, when they achieve
basically the same thing?

I mean, I am beginning to wonder if it is not easier to just stick to
eval() and ignore the method_missing, define_method, class_eval and
instance_eval hacks altogether.

There seems to be a multitude of almost the same thing being done here.

Marc H. wrote in post #1049317:

Why are there so many different ways to eval, when they achieve
basically the same thing?

I mean, I am beginning to wonder if it is not easier to just stick to
eval() and ignore the method_missing, define_method, class_eval and
instance_eval hacks altogether.

There seems to be a multitude of almost the same thing being done here.

I might agree with you when I am a newbie, but one day you will come
across to the necessity of using these glories features of ruby. So grab
a ruby book and read about various favors of eval’s. You will benefit
sooner or later!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs