Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a ruby solution that only affects 2+2:

    class Fixnum
      alias_method :old_plus, :+
      def +(other)
        return 5 if (self == 2 && other == 2)
        old_plus(other)
      end
    end


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: