suggestions icon indicating copy to clipboard operation
suggestions copied to clipboard

Add content to the "let" section of the language guide that talks about destructuring

Open CrowdHailer opened this issue 4 years ago • 2 comments

https://gleam.run/book/tour/let-bindings.html

I'm not sure if this should just be a link to the case section or if it's different enough to have it's own content. Given the hypothetical future of exhaustiveness checking it will be a bit different because only single record varients can be destructured in a let.

CrowdHailer avatar Apr 11 '21 07:04 CrowdHailer

I think this should go in the sections for each data type as if in let it would mean using data structures before they are introduced.

lpil avatar Apr 12 '21 09:04 lpil

Fair enough. I reckon a link is still worth having because I don't think it's mentioned that you can destructure in let's anywhere. Unless it's a deliberate choice to lead people to destructuring with assert.

CrowdHailer avatar Apr 12 '21 10:04 CrowdHailer