-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let
...else
example should demonstrate denesting
#2070
Comments
It seems like the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Often when teaching people are underwhelmed by the utility of the
let
...else
construct. I also don't think it makes a huge amount of sense as presented. The current example consists of several repetitions of the admittedly awkward patternwhich is improved by
let
...else
, but is also not a terribly common pattern on its own, and as I understand things isn't really what motivated this control flow construct.My understanding is that the real utility of
let
...else
is that it allows to de-nest what would otherwise be a rightward-drifting nesting ofif let
s:Which can instead become:
I think this makes the utility of the construct more clear.
The text was updated successfully, but these errors were encountered: