[Cuis-dev] FileMan and FileStream?

Phil (list) pbpublist at gmail.com
Fri Dec 18 21:06:07 CST 2015


On Fri, 2015-12-18 at 18:34 -0800, KenD wrote:
> On Fri, 18 Dec 2015 19:55:57 -0500
> "Phil (list)" <pbpublist at gmail.com> wrote:
> 
> > I don't want to pass a block
> > in, I need to get the read/write stream back.  I have lots of code
> > that
> > is stream based and doesn't know or care if its dealing with a
> > file, it
> > just expects a stream for input/output.
> 
> What about the third pattern?  
> 
> Just turn things inside out and send a message to your stream-using
> code with the kind of (file)Stream it expects.
> 
> SomePath asFileEntry writeStream: [ :file | 
>       myInst streamOperationOn: 
>     	  (SomeStreamClassOrInst someKindaStream on: file) 
>     ]
> 

I could do something like that which will of course end up resulting in
my creating helper methods that look suspiciously, exactly, like
private*Stream.  The main argument I'm making is that accessing files
via streams (which get passed around *a lot*... typically only a bit of
top level code even knows or cares if it is a file) is a pretty common
use case so why not just acknowledge it and make them public in name
and usage?



More information about the Cuis-dev mailing list