Stream programming

Jean-Michel Pichavant jeanmichel at sequans.com
Mon Mar 26 11:27:19 CEST 2012


Kiuhnm wrote:
> [snip]
>
> numbers - push - avrg - 'med' - pop - filter(lt('med'), ge('med'))\
>     - ['same', 'same'] - streams(cat) - 'same'
>
> It reads as
>
> "take a list of numbers - save it - compute the average and named it 
> 'med' - restore the flow - create two streams which have, respect., 
> the numbers less than 'med' and those greater or equal to 'med' - do 
> the /entire/ 'same' process on each one of the two streams - concat 
> the resulting streams - name all this /entire/ process 'same'.
> Not readable enough? Replace 'same' with 'qsort'.
>
> Is that readable or am I going crazy? [note: that's a rhetorical 
> question whose answer is "That's very readable!"]
>
> Kiuhnm

Here's a rhetorical answer to your question : whatever you're taking, I 
want some !

JM



More information about the Python-list mailing list