rename 'Iterable' to 'Stream' w/o breaking code
See original GitHub issueAlright, so here’s a thing I’ve wanted to do forever. It turns out that Iterable
is a really terrible name for the things we call “streams”. The whole perspective of working with streams is to not think of procedurally “iterating” over them. Now, sure, Ceylon’s Iterable
historically grew out of something that filled the same role as Java’s interface of the same name, but it has grown into something quite different.
Now, we could renameIterable
to Stream
without breaking any existing source code simply by creating an alias for it:
shared interface Iterable<out Element=Anything,
out Absent=Null>
given Absent satisfies Null
=> Stream<Element,Absent>;
We could even make it binary compatible by simply munging the name Stream
back to Iterable
in the backend, but at this point I’m not sure that’s even worth the effort, since we’re breaking binary compatibility in the next release anyway.
Thoughts?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:30 (26 by maintainers)
Top GitHub Comments
hey, y’know what would be the coolest thing ever?
A
renamed
annotation that:That would be cool and not even very hard to implement!
Stream
is a really nice name, and I think it would be a waste to use it on something so useless as anIterator
, which is primarily just a temporary object used byfor
loops. And even ifStream
isn’t otherwise used, I’m not sure givingIterator
s a nice name would do anything other than encourage overuse (misuse).