-
Notifications
You must be signed in to change notification settings - Fork 718
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
base: main
Are you sure you want to change the base?
Conversation
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.'); | |||
} | |||
} |
There was a problem hiding this comment.
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, ...? |
There was a problem hiding this comment.
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.
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.