What If Control Flow Were Just Functions?

In Python, when you write if x > 5: print("big"), you’re using special syntax baked into the language. You can’t change how if works. You can’t compose it, pipe it, or partially apply it. You can’t pass if as an argument to another function. But what if you could? What if if, for, and while were just regular functions that followed the same rules as everything else? This isn’t just a theoretical curiosity—it fundamentally changes how you think about and write code. ...

October 6, 2025 · Janko