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

Updated FAQ to Reflect New Dart Feature Considerations #6480

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

MiniPiku
Copy link
Contributor

@MiniPiku MiniPiku commented Mar 8, 2025

This PR updates the FAQ section, replacing the question about tuples and partial evaluation with a more relevant discussion on pattern matching and union types. This change better aligns with current feature requests and community discussions around Dart's type system and pattern capabilities.

1. Renamed the variable json to data throughout the section.
2. Updated the text to clarify that the example works with deserialized data (e.g., parsed from JSON) rather than raw JSON strings.
3. Ensured consistency in variable naming and explanations.

This update makes the documentation more accurate and avoids misleading readers into thinking that the variable holds a JSON string. If you’re contributing to the Dart documentation, you can submit this change as a pull request to the [site-www repository](https://github.com/dart-lang/site-www)
1. **Added 	ypedef Explanation:**
   - Added a section explaining how to use 	ypedef to name record types.
   - Provided an example of defining and using a UserProfile record type.

2. **Improved Readability:**
   - Clarified that 	ypedef can be used to improve code readability and reusability.
…stion about potential language features, since Dart now has records which serve a similar purpose to tuples.
@@ -390,7 +390,7 @@ if (data is Map<String, Object?> &&
var name = user[0] as String;
var age = user[1] as int;
print('User $name is $age years old.');
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added space seems like an unnecessary change to an otherwise unchanged file.

@@ -103,7 +103,7 @@ Dart chooses _familiarity_ over _excitement_.
**Web or Flutter apps**
: No, Dart doesn't support write to [web or Flutter apps][Flutter no mirrors].

### Q. Can Dart add tuples, partial evaluation, ...?
### Q. Can Dart add pattern matching, union types, ...?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaces an existing feature (tuples) by another existing feature (pattern matching) when what ideally should go here is a non-existing feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants