Skip to content

Overview

Suppose you want to print a different greeting depending on the time of day. In Pony, the greeting itself can come from an if expression. One branch gives you "Good morning!", the other gives you "Good evening!", and you can pass the result straight to print.

You’ll start with expressions for simple values, give those values names with variables, and combine them with operators. When you have several patterns to check, you’ll see how to use a match expression. Each case can give you a different result to use in the rest of your calculation.