Compost update December '22: Match, If and Booleans
It’s been due time to add control flow into Compost. We have it now! Match Expressions Match expressions allow you to use different flows based on some element’s type. Here’s an example: lets StringOrNothing(thing: @String | ?): String match matchedThing: thing @String: matchedThing.String ? : 'Nothing' It takes a thing that implements the String trait or not. If it implements String, it returns that string. Otherwise it returns the String ’nothing'....