tuples 1.0.0 copy "tuples: ^1.0.0" to clipboard
tuples: ^1.0.0 copied to clipboard

Dart 1 only

Tuples for Dart.

example/tuples.dart

// Copyright (c) 2015, Michał Stalmach. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library tuples.example;

import 'package:tuples/tuples.dart';

main() {
    Tuple t1 = newTuple(1, 'a', {});

    print(t1); // outputs: <1, a, {}>

    print(t1.elementAt(1)); // outputs: a

    print(t1.length); // outputs: 3

    print(newTuple('a', 1, false) == newTuple('a', 1, false)); // outputs: true

    TupleIterator iterator = new TupleIterator(newTuple('a', 1, false));
    print(iterator.current); // outputs: a
    print(iterator.moveNext()); // outputs: true
    print(iterator.current); // outputs: 1
}
0
likes
30
points
7
downloads

Publisher

unverified uploader

Weekly Downloads

Tuples for Dart.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (license)

Dependencies

quiver

More

Packages that depend on tuples