Comment on Write a program that makes 2 + 2 = 5parentComments−eqnoob12312yHere's one in Ocaml that modifies the + operatorlet (+) x y = match (x,y) with (2,2) -> 5 | (x,y) -> x+y;;−a-nikolaev12yA shorter one:let (+) 2 2 = 5 in 2+2;;
Comments
Here's one in Ocaml that modifies the + operator
let (+) x y = match (x,y) with (2,2) -> 5 | (x,y) -> x+y;;
A shorter one:
let (+) 2 2 = 5 in 2+2;;