3 ms·
It works well in cases where you have an operation that consists of a certain sequence of statements, where one of the statements has to be omitted in a particu
by layer8 4y ago
It works well in cases where you have an operation that consists of a certain sequence of statements, where one of the statements has to be omitted in a particular atypical situation. Instead of having interrupt the sequence with an if, you just tag the particular statement with the omitting condition at the end. That’s also when unless tends to be intuitive, because it suggests an atypical condition.
- hosh 4y agoThat is usually where I used it too. When I started writing these as pipeline execution. Then I’ll use a maybe?() instead if the conditional does not need to depend on the result of a previous operation.