site-www icon indicating copy to clipboard operation
site-www copied to clipboard

Add tear-off, lambda, and closure to the language tour

Open kwalrath opened this issue 7 years ago • 2 comments

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.

kwalrath avatar Sep 17 '18 22:09 kwalrath

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.

kwalrath avatar Jul 28 '21 21:07 kwalrath

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.

jamesderlin avatar Sep 05 '21 19:09 jamesderlin

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.

atsansone avatar May 20 '24 21:05 atsansone

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 avatar May 21 '24 07:05 jamesderlin

@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!

atsansone avatar May 21 '24 18:05 atsansone