A dedicated function for evaluating Void returning closures when Optional instance is not nil

I think your point about verbosity only being one factor is definitely key. I realized only after my latest post in this thread that there’s a totally separate pitch right now that is proposing adding if let something as shorthand for if let something = something with largely different motivations ([Syntax] Default name for optional binding self and other properties).

I guess where I land in the end is I acknowledge that they address a different set of goals that merely overlap and I happen to be more interested in seeing the if let shorthand but (1) I can’t think of an argument against having the method you are looking for, (2) there’s precedent with forEach, and (3) I’d probably use it on occasion (as has been the case with forEach).

1 Like