This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TRUE = (p) => (q) => (p) | |
const FALSE = (p) => (q) => (q) | |
const OR = (p) => (q) => p(p)(q) | |
const NOT = (p) => (p)(FALSE)(TRUE) | |
const AND = (p) => (q) => (p)(q)(FALSE) | |
const PROG = (func) => FALSE(func())(PROG) | |
const PRINT = (text) => () => TRUE(console.log(text)) | |
const IF = (cond) => (execute) => (nonexecute) => (cond(execute)(nonexecute))() | |
PROG |