SE-0345: `if let` shorthand for shadowing an existing optional variable

(a) If that argument is sufficiently convincing for you as to merit an addition to the language, then it argues for a proposal that covers all shadowing and not just in the case of if let unwrapping (not to mention that you’d want a shorthand that indicates that something was shadowed rather than entirely omitting any written artifact of the operation)—which this proposal does not do, nor even lists as an alternative, even though I raised the point many years ago and others are raising it even now.

(b) Continuing on the theme of tools-level support, this is an excellent example of something that can be addressed by syntax highlighting.

Again, this entire line of argumentation has been discussed before too, and I don’t think anything I’ve said nor anything I’ve replied to has been unmentioned years ago already and many times since, illustrating again the overarching point that I fail to see what has merited review now nor what is accomplished by it.

8 Likes