Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #22094
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <nathan.alexander.rice@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.008 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'example:': 0.03; 'behavior,': 0.07; 'defines': 0.07; 'flows': 0.07; '[0,': 0.09; '[0]': 0.09; 'definitions.': 0.09; 'indicates': 0.09; 'streams.': 0.09; 'binary': 0.13; '[2,': 0.16; 'calculus,': 0.16; 'disregard': 0.16; 'ring,': 0.16; 'stream.': 0.16; 'subject:programming': 0.16; '\xa0you': 0.16; 'this:': 0.16; '>>>': 0.18; 'trying': 0.21; 'header:In-Reply-To:1': 0.22; 'exploring': 0.23; 'implicit': 0.23; 'elements': 0.24; 'module': 0.26; 'code': 0.26; 'work.': 0.27; 'skip:[ 10': 0.27; 'message-id:@mail.gmail.com': 0.29; 'explicit': 0.29; 'module.': 0.29; 'problem': 0.29; 'cases.': 0.30; 'equivalent': 0.31; "isn't": 0.33; 'sort': 0.33; 'there': 0.33; "won't": 0.33; 'rules': 0.34; 'smart': 0.34; 'operations': 0.35; 'to:addr:python-list': 0.35; 'however,': 0.35; 'received:209.85.160': 0.36; 'extend': 0.36; 'two': 0.36; 'requirements': 0.37; 'run': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'another': 0.37; 'either': 0.37; 'received:209.85': 0.38; 'could': 0.38; 'some': 0.38; 'think': 0.38; 'non': 0.38; 'received:209.85.160.46': 0.39; 'skip:\xa0 10': 0.39; 'clearly': 0.39; 'option': 0.39; 'received:209': 0.39; 'point': 0.40; 'being': 0.40; 'to:addr:python.org': 0.40; 'more': 0.61; 'your': 0.61; 'meet': 0.61; 'conceptual': 0.67; 'therefore,': 0.68; 'stated': 0.70; 'ring': 0.77; 'stream': 0.77; 'communicate,': 0.84; 'streams': 0.84; 'intends': 0.91; 'treatment': 0.97 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=za9cHy6Kgi0KjkvAc5KAhcpTq1AHwamVUrA8iiYHk7A=; b=HN+04/nBdPI212XS9AUyX+Q9GWBqeNtIOrlGS8VKV5Ph7tZ+FkY71vUGgF3UcLEDGh 4vOPh3o8vXiTCy3f5T2YnkCxOtHB1NpbaEUY2gT2C+8udKjbfp+J3hEjFZGJMA389mhx AoAaq7JrQI0sUSUsgqGPtX/NXzOACqMesJjCGmHy3RXeTYJz2RCAozPhrlWupYu2kMca NhJ+VJuX8t7nDfzQRFNcEH4UK6tPToO2XQP/ks+m617NLLDfWMyB4AdN1KM1FAZ9IksM 4s9kAvG6OhrSpUGpdt3ZqANffLeba083b9MwUZeJAiiDdzDFpURo6cGIlxJ5FdOWclDe CLRg== |
| MIME-Version | 1.0 |
| In-Reply-To | <4F6CBA4C.3020206@mrabarnett.plus.com> |
| References | <4f6c9e17$0$1383$4fafbaef@reader2.news.tin.it> <CAOFbRmL63M5TZ4mqaz70J04HVP6OiKVSYBudayHwJUt-SZ1QFA@mail.gmail.com> <4F6CBA4C.3020206@mrabarnett.plus.com> |
| Date | Fri, 23 Mar 2012 15:23:00 -0400 |
| Subject | Re: Stream programming |
| From | Nathan Rice <nathan.alexander.rice@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| 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.943.1332530583.3037.python-list@python.org> (permalink) |
| Lines | 64 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1332530583 news.xs4all.nl 6926 [2001:888:2000:d::a6]:39160 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:22094 |
Show key headers only | View raw
>>> 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. I understand how he wants the system to work in this case; my point was that it isn't consistent. He stated flows can be concatenated, so [0] is just a flow of a single stream. Because he clearly intends that streams in a flow are ordered, that indicates that he wants some sort of algebraic module. He could get close if he can extend a stream to meet the requirements of a ring, then a flow would be a module over the ring of streams. The problem he is going to run into is that operations on streams as he defines them are not commutative. Identity elements for the two binary operations are also not immediately obvious to me. He could just be smart and use the pi calculus, it is rigorously developed and can model his desired behavior, if he reformulates it slightly. Another option is just to give up on being rigorous. Given the abstract treatment he attempted I would be disappointed, but if his only goal is to get practice writing code and he isn't interested in exploring the conceptual space of the problem domain it would be the right decision.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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