1 of 2
Kamila Borowska
  • 12.1k
  • 3
  • 56
  • 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;
Kamila Borowska
  • 12.1k
  • 3
  • 56
  • 93