Den 25.08.2010 12:58, skrev Bart Gauquie:
On Wed, Aug 25, 2010 at 10:38 AM, Henrik Johansen <henrik.s.johansen@veloxit.no <mailto:henrik.s.johansen@veloxit.no>> wrote:
Den 24.08.2010 17:58, skrev Nicolas Cellier: > 2010/8/24 Schwab,Wilhelm K <bschwab@anest.ufl.edu <mailto:bschwab@anest.ufl.edu>>: > >> This cropped up in Dolphin some years back. IIRC, OA's answer was that streams historically worked on only Array and maybe something else. Having said that, they relaxed a constraint because it was harmless and a good idea. >> >> I'm not sure about streaming over a set; lack of order means that it might be tricky to maintain a reasonable position?? >> >> > Exactly, the Stream would hardly be positionable, unless you use a > sort of OrderedSet... > A ReadWriteStream would be problematic for the same reasons. > > What would be the interest of such a Stream ? > (I mean something more than what just you can do with #do:or #add:) > > Nicolas +1. I don't quite see what use could would find in a stream of a non-sequenced source that is not better served by using a different abstraction, or the source itself..
Cheers, Henry
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr <mailto:Pharo-project@lists.gforge.inria.fr> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Ok, but why can you then do a collect:[] / select:[] / do: [] over a set? It also iterates over all the elements. So why is it then strange to have a readstream over a set? I'm not saying it should be a positionable stream.
But I also agree that is more logical to only do a ReadStream over a SequenceableCollection if you take into account positions ... Maybe change the code so that it only accepts a SequenceableCollection?
Haven't tried Nile yet.
Kind Regards,
Bart
Yes they iterate of the elements, but they don't really care about which. sequence the elements are in. Sure you can write a block to pass to them which does, but I doubt you'd want to use that with a Set or a Dictionary. #next, #nextPut:, #upTo: and the rest of the Stream protocol certainly do care what sequence the elements are in. Cheers, Henry