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

Common interface #13

Closed
Solido opened this issue Sep 4, 2019 · 5 comments
Closed

Common interface #13

Solido opened this issue Sep 4, 2019 · 5 comments

Comments

@Solido
Copy link

Solido commented Sep 4, 2019

It would it very convenient to have a common interface for tuple : Tuple

So you can store List but add different implementations.
Currently I need to strongly type on Tuple2 but some result got more entries.

This interface Tuple can gives you the number of index (arity) and allow access to value by index and an iterator.

Thank you !

@Solido Solido changed the title Abstract class Common interface Sep 4, 2019
@alextekartik
Copy link

Indeed it would great to know if a value is Tuple without having to check each type one by one (is Tuple2, is Tuple3...). It could also a share the common toList method they all have:

/// Represents a tuple.
abstract class Tuple {
  /// Creates a [List] containing the items of this [Tuple].
  ///
  /// The elements are in item order. The list is variable-length
  /// if [growable] is true.
  List toList({bool growable = false});
}

@Solido
Copy link
Author

Solido commented Apr 6, 2020 via email

@alextekartik
Copy link

Thanks for the information @Solido. Is there any place I could look for more information (current status, planned implementation) as I could not find relevant information so far?

@Solido
Copy link
Author

Solido commented Apr 11, 2020

@Solido Solido closed this as completed Apr 11, 2020
@Solido
Copy link
Author

Solido commented Apr 11, 2020

And dart-lang/language#68

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

No branches or pull requests

2 participants