2009/2/8 GáÃor SebestyñÏ <segabor / gmail.com>:
> For instance, I want to decide whether the conditional expressions of
> two subsequent IFs are the same (or equivalent). I know it's not easy
> in most cases.
>
> Let's see a primitive example:
>
>  if A then
>   do_something1
>  end
>
>  if B
>    do_something2
>  end
>
> If A and B equals their conditional branches could be joined.
>
> I'm investigating how it would be easy evaluate A and B whether they
> are both true or false.
> I need this in my refactoring experiment.

You are aware that expressions A and B can have side effects which
makes it practically impossible to decide on the equivalence?  Keep in
mind that Ruby is not a pure functional language.

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end