[antlr-interest] Mantra language overhaul / reimplementation

Martin Probst mail at martin-probst.com
Mon Sep 24 00:33:13 PDT 2007


Hi,

> You might also find the pipeline oriented programming (POP?) quite  
> interesting.  You can create new functionality by piping actors  
> together rather than adding methods to classes. For example,  
> imagine providing a facility for converting a file to a stream of  
> lines. The traditional way is to create a lines() method in File  
> and then call f.lines(). You could also add f.words() and so on.  
> But, the exact same functionality is useful for strings and any  
> other stream of characters.  Pipelines offer a better solution.  
> Create a single input/output processor (an actor) and then pipe an  
> input source to the actor.

That's somewhat like the Java io library and it's wrapper pattern,  
isn't it? You have an InputStream (e.g. FileInputStream) and wrap it  
in an InputStreamReader to get characters instead of bytes, then in a  
BufferedReader to get .readLine(), etc.

How do you achieve compatibility of the single pipe steps? I.e. if  
one step returns 'Fish', and the next step expects 'Salmon', or maybe  
even something incompatible?

Regards,
Martin


More information about the antlr-interest mailing list