Documenting when the closure "bug" (#15276) binds, and how to avoid it for introductory users

Perhaps this previous Internals & Design thread would be helpful for folks that want to dig in deeper as to why and how this occurs:

In short, it is a predictable syntactic transform (albeit with complicated rules). You don’t need any types or previous definitions (beyond macros) to see if it’ll occur. Just check Meta.@lower for Boxes. I’d love to find some time to spend with linting — this is highly lintable and could be flagged by an editor.

IMO: Closures can be a challenging topic to teach. Focus on the behavior first. This performance snag is just going to further confuse things unless you’re very careful.

1 Like