Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22090

Re: Stream programming

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'example:': 0.03; 'flows': 0.07; '[0,': 0.09; '[0]': 0.09; 'definitions.': 0.09; 'from:addr:python': 0.09; '[2,': 0.16; 'disregard': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'reply- to:addr:python-list': 0.16; 'subject:programming': 0.16; 'this:': 0.16; 'wrote:': 0.18; 'trying': 0.21; 'header:In-Reply-To:1': 0.22; 'implicit': 0.23; 'work.': 0.27; 'skip:[ 10': 0.27; 'explicit': 0.29; 'cases.': 0.30; 'equivalent': 0.31; 'there': 0.33; "won't": 0.33; 'header:User-Agent:1': 0.33; 'rules': 0.34; 'received:84': 0.34; 'reply-to:addr:python.org': 0.34; 'to:addr :python-list': 0.35; 'however,': 0.35; 'two': 0.36; 'but': 0.37; 'either': 0.37; 'some': 0.38; 'think': 0.38; 'non': 0.38; 'to:addr:python.org': 0.40; 'more': 0.61; 'your': 0.61; 'therefore,': 0.68; 'header:Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.72; 'stream': 0.77; 'communicate,': 0.84; 'nathan': 0.84; 'streams': 0.84
X-CM-Score 0.00
X-CNFS-Analysis v=2.0 cv=Dp/UCRD+ c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=qePWxsfFzlIA:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=aXwN2fR8gm82CRp9INgA:9 a=wPNLvfGTeEIA:10 a=rtiCEioeswrPv96u:21 a=U9yz7XJ35L9l0Ssq:21 a=0nF1XD0wxitMEM03M9B4ZQ==:117
X-AUTH mrabarnett:2500
Date Fri, 23 Mar 2012 18:00:44 +0000
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: Stream programming
References <4f6c9e17$0$1383$4fafbaef@reader2.news.tin.it> <CAOFbRmL63M5TZ4mqaz70J04HVP6OiKVSYBudayHwJUt-SZ1QFA@mail.gmail.com>
In-Reply-To <CAOFbRmL63M5TZ4mqaz70J04HVP6OiKVSYBudayHwJUt-SZ1QFA@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.941.1332525634.3037.python-list@python.org> (permalink)
Lines 40
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1332525634 news.xs4all.nl 6957 [2001:888:2000:d::a6]:46537
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:22090

Show key headers only | View raw


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] | [3,4]) + [10]<=>  [0,1,2,10] | [0,3,4,10]
>>    ([1,2] | [10,20]) + ([3,4] | [30,40])<=>  [1,2,3,4] | [10,20,30,40]
>
> Algebraically, your concatenation rules don't really make sense - your
> flows are both distributive and non distributive.  You also make the
> implicit assumption of an order over streams in a flow, but disregard
> the implications of that assumption in some cases.  I understand what
> you're trying to communicate, so I think you need to be a little more
> strict and explicit in your definitions.
>
When concatenating, either there are the same number of streams, or one
of them is a single stream which is duplicated.

Therefore, in this example:

     [0] + ([1, 2] | [3, 4])

you're concatenating a single stream with a pair, so the single stream
is duplicated:

     ([0] | [0]) + ([1, 2] | [3, 4])

and then they can be concatenated:

     ([0, 1, 2] | [0, 3, 4])

However, this:

     ([0, 1] | [2, 3]) + ([4, 5] | [6, 7] | [8, 9])

won't work.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-23 17:00 +0100
  Re: Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-23 17:02 +0100
  Re: Stream programming Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-03-23 12:33 -0400
    Re: Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-23 21:33 +0100
      Re: Stream programming Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-03-23 17:18 -0400
        Re: Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-24 01:26 +0100
      Re: Stream programming Ethan Furman <ethan@stoneleaf.us> - 2012-03-23 14:12 -0700
        Re: Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-24 00:57 +0100
  Re: Stream programming MRAB <python@mrabarnett.plus.com> - 2012-03-23 18:00 +0000
  Re: Stream programming Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-03-23 15:23 -0400
    Re: Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-23 21:44 +0100
  Re: Stream programming Ray Song <emacsray@gmail.com> - 2012-03-24 07:32 +0800
    Re: Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-24 01:41 +0100
  Re: Stream programming Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-24 03:23 +0000
    Re: Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-24 12:05 +0100
  Re: Stream programming Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-03-26 11:27 +0200
    Re: Stream programming Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-26 13:45 +0200

csiph-web