site-www
site-www copied to clipboard
Add tear-off, lambda, and closure to the language tour
The language tour should at least briefly cover all the terms that Effective Dart mentions (especially those in guideline headings). The terms tear-off, lambda, and closure are in the guideline DON’T create a lambda when a tear-off will do.
The terms lambda and closure are mentioned in https://dart.dev/guides/language/language-tour#anonymous-functions. We still need to add tear-off, especially since we'll have constructor tear-offs soon.
Lambda and closure also are more common terms, should be known to people with computer science backgrounds, and can be looked up on Wikipedia (lambda (programming), closure (computer programming)). In contrast, I have never seen the term "tear-off" before learning Dart.
Lambdas and closures are covered in https://dart.dev/language/functions#anonymous-functions.
Constructor tear-offs will be covered in https://github.com/dart-lang/site-www/issues/3577. Closing this issue.
Constructor tear-offs will be covered in #3577. Closing this issue.
The tear-off aspect of this issue was about tear-offs in general. The term "tear-off" isn't defined anywhere in the Dart Language Tour, despite being mentioned in Effective Dart. Issue #3577 is about constructor tear-offs, which is a special case because the tear-off for the unnamed constructor needs special syntax (ClassName.new).
If the intent is to repurpose #3577 to be about tear-offs in general, that's fine, but then that issue should be updated to make it clear that it's no longer specifically about constructor tear-offs.
@jamesderlin : I did add tear-offs to the PR: https://github.com/dart-lang/site-www/pull/5850. Lambdas and closures were already there. Thanks for the prompt!