As of May 31, 2023, we have updated our Code of Conduct.
1 of 2
Konrad Borowski
  • 12.1k
  • 3
  • 54
  • 93

Perl 6

Perl 6 makes easy things easy and the hard things possible. Making 2 + 2 equal 5 is an easy thing. You just need to redefine + infix to specially treat those integers. This also works with code like (1 + 1) + (1 + 1). And, 2 + 4 is still 6, so it's not that old meaning of + has disappeared.

multi infix:<+>(2, 2) { 5 }
say 2 + 2;
Konrad Borowski
  • 12.1k
  • 3
  • 54
  • 93