2009/6/8 Damien Cassou <damien.cassou@gmail.com>:
On Sun, Jun 7, 2009 at 2:15 AM, Nicolas Cellier<nicolas.cellier.aka.nice@gmail.com> wrote:
Before adding a new set of messages, why not make the endOfStream pluggable?
I'm not sure it will work because different methods will expect different behavior. Thus these methods won't be able to communicate with the same stream.
I see what you mean, Stream internally use endOfStream handling for implementing some of its protocol and must therefore know whether an endOfStream event will return nil or raise an Exception, is that it? Messages that use construct like: [self atEnd] whileFalse: [...] should always work. Messages that use constructs like: [(char := stream next) ~~ nil] whileTrue: [...] could eventually be written: | oldEndOfStream | oldEndOfStream := endOfStream. [[(char := stream next) ~~ nil] whileTrue: [...]] ensure: [endOfStream := oldEndOfStream]. Nicolas
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project