Re: Stream programming

2012-03-26 Thread Kiuhnm
On 3/26/2012 11:27, Jean-Michel Pichavant wrote: 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 - crea

Re: Stream programming

2012-03-26 Thread Jean-Michel Pichavant
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 num

Re: Stream programming

2012-03-24 Thread Kiuhnm
On 3/24/2012 4:23, Steven D'Aprano wrote: On Fri, 23 Mar 2012 17:00:23 +0100, Kiuhnm wrote: I've been writing a little library for handling streams as an excuse for doing a little OOP with Python. I don't share some of the views on readability expressed on this ng. Indeed, I believe that a pie

Re: Stream programming

2012-03-23 Thread Steven D'Aprano
On Fri, 23 Mar 2012 17:00:23 +0100, Kiuhnm wrote: > I've been writing a little library for handling streams as an excuse for > doing a little OOP with Python. > > I don't share some of the views on readability expressed on this ng. > Indeed, I believe that a piece of code may very well start as c

Re: Stream programming

2012-03-23 Thread Kiuhnm
On 3/24/2012 0:32, Ray Song wrote: On Fri, Mar 23, 2012 at 05:00:23PM +0100, Kiuhnm wrote: I've been writing a little library for handling streams as an excuse for doing a little OOP with Python. I don't share some of the views on readability expressed on this ng. Indeed, I believe that a piece

Re: Stream programming

2012-03-23 Thread Kiuhnm
On 3/23/2012 22:18, Nathan Rice wrote: I understand what you're trying to communicate, so I think you need to be a little more strict and explicit in your definitions. No, I don't think you understand what I meant. I don't agree. Sorry. You could just point out those inconsistencies that

Re: Stream programming

2012-03-23 Thread Kiuhnm
;t read *everything*, but I do read quite a bit -- especially the stuff that looks like it might be interesting... like "stream programming", for example. ;) After the discussion I've seen so far, I still have no idea how I would use your code or what it's good for. The idea

Re: Stream programming

2012-03-23 Thread Ray Song
On Fri, Mar 23, 2012 at 05:00:23PM +0100, Kiuhnm wrote: > I've been writing a little library for handling streams as an excuse for > doing a little OOP with Python. > > I don't share some of the views on readability expressed on this ng. > Indeed, I believe that a piece of code may very well start

Re: Stream programming

2012-03-23 Thread Ethan Furman
types that use Python. I've seen occasional discussion of functional programming, but I've only seen anything this confusing maybe twice before... granted, I don't read *everything*, but I do read quite a bit -- especially the stuff that looks like it might be interesting...

Re: Stream programming

2012-03-23 Thread Nathan Rice
>>  I understand what >> you're trying to communicate, so I think you need to be a little more >> strict and explicit in your definitions. > > > No, I don't think you understand what I meant. I don't agree. Sorry. > Yes. I thought that streams as an alternative to functional programming were > wi

Re: Stream programming

2012-03-23 Thread Kiuhnm
On 3/23/2012 20:23, Nathan Rice wrote: I will use "<=>" to mean "is equivalent to". That's not part of the DSL. A flow has one or more streams: 1 stream: [1,2,3] 2 streams: [1,3,5] | [2,4,6] Two flows can be concatenated: [1,2,3] + [4,5,6]<=>[1,2,3,4,5,6] [0] + ([1

Re: Stream programming

2012-03-23 Thread Kiuhnm
On 3/23/2012 17:33, Nathan Rice wrote: I will use "<=>" to mean "is equivalent to". That's not part of the DSL. A flow has one or more streams: 1 stream: [1,2,3] 2 streams: [1,3,5] | [2,4,6] Two flows can be concatenated: [1,2,3] + [4,5,6]<=> [1,2,3,4,5,6] [0] + ([1,2] | [3,4]) +

Re: Stream programming

2012-03-23 Thread Nathan Rice
>>>  I will use "<=>" to mean "is equivalent to". That's not part of the DSL. >>>  A flow has one or more streams: >>>   1 stream: >>>     [1,2,3] >>>   2 streams: >>>     [1,3,5] | [2,4,6] >>>  Two flows can be concatenated: >>>   [1,2,3] + [4,5,6]<=>  [1,2,3,4,5,6] >>>   [0] + ([1,2] | [3,4]) + [

Re: Stream programming

2012-03-23 Thread MRAB
On 23/03/2012 16:33, Nathan Rice wrote: I will use "<=>" to mean "is equivalent to". That's not part of the DSL. A flow has one or more streams: 1 stream: [1,2,3] 2 streams: [1,3,5] | [2,4,6] Two flows can be concatenated: [1,2,3] + [4,5,6]<=> [1,2,3,4,5,6] [0] + ([1,2]

Re: Stream programming

2012-03-23 Thread Nathan Rice
> I will use "<=>" to mean "is equivalent to". That's not part of the DSL. > A flow has one or more streams: >  1 stream: >    [1,2,3] >  2 streams: >    [1,3,5] | [2,4,6] > Two flows can be concatenated: >  [1,2,3] + [4,5,6] <=> [1,2,3,4,5,6] >  [0] + ([1,2] | [3,4]) + [10] <=> [0,1,2,10] | [0,3,4

Re: Stream programming

2012-03-23 Thread Kiuhnm
On 3/23/2012 17:00, Kiuhnm wrote: I've been writing a little library for handling streams as an excuse for doing a little OOP with Python. I don't share some of the views on readability expressed on this ng. Indeed, I believe that a piece of code may very well start as complete gibberish and bec

Stream programming

2012-03-23 Thread Kiuhnm
I've been writing a little library for handling streams as an excuse for doing a little OOP with Python. I don't share some of the views on readability expressed on this ng. Indeed, I believe that a piece of code may very well start as complete gibberish and become a pleasure to read after som