Skip to content
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

Add Wildcard Variables feature to the Language docs #5833

Open
Tracked by #55673
kallentu opened this issue May 16, 2024 · 0 comments
Open
Tracked by #55673

Add Wildcard Variables feature to the Language docs #5833

kallentu opened this issue May 16, 2024 · 0 comments
Assignees
Labels
a.language Relates to the Dart language tour e2-days Can complete in < 5 days of normal, not dedicated, work p2-medium Necessary but not urgent concern. Resolve when possible. st.triage.ltw Indicates Lead Tech Writer has triaged

Comments

@kallentu
Copy link
Member

kallentu commented May 16, 2024

This issue tracks the work needed for wildcard variable docs.

Summary

Extends the wildcard behavior of patterns to more of the language, making local variables and parameters named _ non-binding.

Eval

  • Add section to the Variables page
  • Define wildcard variables:
    • non-binding, never in scope
    • new behavior applicable to top-level variables, parameters, (list all)
    • naming behavior doesn't affect top-level declarations (list all)
  • Motivating examples:
    • anywhere you don't care about the value, just need a placeholder
    • annoying that _ binds a name and is therefore not reusable; removes the need for multiple underscore naming
  • Any special cases/unexpected behavior for certain applications:
    • TBD (probably not)

Resources

@kallentu kallentu added the a.language Relates to the Dart language tour label May 16, 2024
@atsansone atsansone added p2-medium Necessary but not urgent concern. Resolve when possible. e2-days Can complete in < 5 days of normal, not dedicated, work st.triage.ltw Indicates Lead Tech Writer has triaged labels May 17, 2024
@atsansone atsansone changed the title [Wildcard Variables] Language feature docs Add Wildcard Variables feature to the Language docs May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.language Relates to the Dart language tour e2-days Can complete in < 5 days of normal, not dedicated, work p2-medium Necessary but not urgent concern. Resolve when possible. st.triage.ltw Indicates Lead Tech Writer has triaged
Projects
None yet
Development

No branches or pull requests

3 participants