Sink in dart:core

88 views
Skip to first unread message

Moises Belchin

unread,
Apr 12, 2014, 1:33:23 PM4/12/14
to General Dart Discussion
Hi all,

If i'm right with release 18144 the Sink interface was moved from dart:core to dart:async and now with Dart 1.3 this interface comes back to dart:core.

Why this interface comes back to dart:core?
Can someone gives samples of using Sink?

Thanks and regards.

------------------------------------------------------------------------
Un Saludo.
Moisés Belchín.

Florian Loitsch

unread,
Apr 15, 2014, 11:55:21 AM4/15/14
to General Dart Discussion
We added it back in order to unify dart:io and dart:convert.
We found that having a common interface ("Sink") for this common operation is useful enough to add it to core. Eventually we want to replace `ChunkedConversionSink` with simply `Sink` and thus make the converters more interoperable.

Converters also show a good way to use it.


--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.



--
Give a man a fire and he's warm for the whole day,
but set fire to him and he's warm for the rest of his life. - Terry Pratchett

Sean Eagan

unread,
Apr 15, 2014, 12:28:59 PM4/15/14
to General Dart Discussion
Adding Sink to dart:core would break any library which imports dart:core without a prefix (almost all) AND references a Sink from some other library.  I don't think Sink is that common of a name, but I wonder if anyone was affected.  Another reason I'm interested is because it has implications for when Clock could potentially be added.

Cheers,
Sean Eagan

Peter Ahé

unread,
Apr 15, 2014, 12:33:40 PM4/15/14
to mi...@dartlang.org


On Tuesday, April 15, 2014, Sean Eagan <seane...@gmail.com> wrote:
Adding Sink to dart:core would break any library which imports dart:core without a prefix (almost all) AND references a Sink from some other library.  

Nope. We found a solution for that particular problem. Names in platform libraries are ignored if there is a conflict. 

Cheers,
Peter

Sean Eagan

unread,
Apr 15, 2014, 12:41:14 PM4/15/14
to General Dart Discussion
Great to know!

Thanks,
Sean Eagan
Reply all
Reply to author
Forward
0 new messages