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
On 3/23/2012 22:12, Ethan Furman wrote: Kiuhnm wrote: On 3/23/2012 17:33, Nathan Rice wrote: Given the examples you pose here, it is clear that you are assuming that the streams are synchronized in discrete time. Since you do not provide any mechanism for temporal alignment of streams you are a

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
Kiuhnm wrote: On 3/23/2012 17:33, Nathan Rice wrote: Given the examples you pose here, it is clear that you are assuming that the streams are synchronized in discrete time. Since you do not provide any mechanism for temporal alignment of streams you are also assuming every stream will have an e

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