Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Heuristics are bug ridden by definition. If they didn't have bugs, then they'd be algorithms.


devel / comp.lang.python / Re: on writing a while loop for rolling two dice

SubjectAuthor
* on writing a while loop for rolling two diceHope Rouselle
+* Re: on writing a while loop for rolling two diceStefan Ram
|`* Re: on writing a while loop for rolling two diceHope Rouselle
| +* Re: on writing a while loop for rolling two diceHope Rouselle
| |+* Re: on writing a while loop for rolling two diceStefan Ram
| ||`- Re: on writing a while loop for rolling two diceHope Rouselle
| |+- Re: on writing a while loop for rolling two diceAlan Gauld
| |`- RE: on writing a while loop for rolling two diceAvi Gross
| `* Re: on writing a while loop for rolling two dicedn
|  `* Re: on writing a while loop for rolling two diceHope Rouselle
|   +* Re: on writing a while loop for rolling two diceChris Angelico
|   |`* Re: on writing a while loop for rolling two diceHope Rouselle
|   | `* Re: on writing a while loop for rolling two diceMichael F. Stemper
|   |  +- Re: on writing a while loop for rolling two diceHope Rouselle
|   |  +- Re: on writing a while loop for rolling two diceDennis Lee Bieber
|   |  `* RE: on writing a while loop for rolling two diceAvi Gross
|   |   +* Re: on writing a while loop for rolling two diceStefan Ram
|   |   |+* Re: on writing a while loop for rolling two diceGrant Edwards
|   |   ||+* Re: on writing a while loop for rolling two dicealister
|   |   |||+- RE: on writing a while loop for rolling two diceAvi Gross
|   |   |||+- Re: on writing a while loop for rolling two diceRichard Damon
|   |   |||`- RE: on writing a while loop for rolling two diceAvi Gross
|   |   ||+- Re: on writing a while loop for rolling two diceHope Rouselle
|   |   ||`* Re: on writing a while loop for rolling two diceGreg Ewing
|   |   || +* RE: on writing a while loop for rolling two diceAvi Gross
|   |   || |`* Re: on writing a while loop for rolling two dicecharles hottel
|   |   || | +- Re: on writing a while loop for rolling two diceGrant Edwards
|   |   || | +- Re: on writing a while loop for rolling two diceGrant Edwards
|   |   || | +- RE: on writing a while loop for rolling two diceAvi Gross
|   |   || | `- Re: on writing a while loop for rolling two diceDennis Lee Bieber
|   |   || `- Re: on writing a while loop for rolling two dicePeter J. Holzer
|   |   |+- Re: on writing a while loop for rolling two diceAlan Gauld
|   |   |+- Re: on writing a while loop for rolling two diceDennis Lee Bieber
|   |   |+- Re: on writing a while loop for rolling two diceGrant Edwards
|   |   |`- Re: on writing a while loop for rolling two diceDennis Lee Bieber
|   |   `- Re: on writing a while loop for rolling two diceGreg Ewing
|   `* Re: on writing a while loop for rolling two dicePeter J. Holzer
|    `- Re: on writing a while loop for rolling two diceHope Rouselle
+- Re: on writing a while loop for rolling two diceChris Angelico
+- Re: on writing a while loop for rolling two diceTerry Reedy
+- Re: on writing a while loop for rolling two dicePeter Otten
+- Re: on writing a while loop for rolling two dicedn
+- Re: on writing a while loop for rolling two diceChris Angelico
+- Re: on writing a while loop for rolling two dicePeter Otten
+- Re: on writing a while loop for rolling two dicedn
+- Re: on writing a while loop for rolling two diceChris Angelico
+- Re: on writing a while loop for rolling two dicedn
+* RE: on writing a while loop for rolling two diceDavid Raymond
|`* Re: on writing a while loop for rolling two diceHope Rouselle
| `* RE: on writing a while loop for rolling two diceAvi Gross
|  `* Re: on writing a while loop for rolling two diceStefan Ram
|   +- RE: on writing a while loop for rolling two diceAvi Gross
|   +- Re: on writing a while loop for rolling two dice2QdxY4RzWzUUiLuE
|   +- RE: on writing a while loop for rolling two diceAvi Gross
|   +- Non sequitur: on writing a while loop for rolling two diceDennis Lee Bieber
|   `- Non sequitur: on writing a while loop for rolling two diceDennis Lee Bieber
+* Re: on writing a while loop for rolling two diceChris Angelico
|`* Re: on writing a while loop for rolling two diceHope Rouselle
| `- Re: on writing a while loop for rolling two diceChris Angelico
+- Re: on writing a while loop for rolling two dicePeter Otten
+- Re: on writing a while loop for rolling two diceChris Angelico
+- Re: on writing a while loop for rolling two dicePeter Otten
+- Re: on writing a while loop for rolling two dicelucas
+- Re: on writing a while loop for rolling two dicedn
+- Re: on writing a while loop for rolling two diceChris Angelico
+* Re: on writing a while loop for rolling two dicedn
|`- Re: on writing a while loop for rolling two diceHope Rouselle
`- Re: on writing a while loop for rolling two diceAndrew Jaffe

Pages:123
Re: on writing a while loop for rolling two dice

<ipqgn3FqmbtU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19467&group=comp.lang.python#19467

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: greg.ewing@canterbury.ac.nz (Greg Ewing)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Wed, 8 Sep 2021 13:07:47 +1200
Lines: 15
Message-ID: <ipqgn3FqmbtU1@mid.individual.net>
References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net Y1UgGDf1QuHcYbEHOAG0Kgs6e8YT8VZMjinZkPRCsT0wYkTaVn
Cancel-Lock: sha1:Qt4roGjURWodzNH+JoxRjDbJUXs=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:78.0)
Gecko/20100101 Thunderbird/78.4.0
In-Reply-To: <mailman.657.1631033041.4164.python-list@python.org>
Content-Language: en-US
 by: Greg Ewing - Wed, 8 Sep 2021 01:07 UTC

On 8/09/21 2:53 am, Grant Edwards wrote:
> #define IF if (
> #define THEN ) {
> #define ELSE } else {
> #define ENDIF }
> ...

I gather that early versions of some of the Unix utilities were
written by someone who liked using macros to make C resemble Algol.

I guess you can get away with that sort of thing if you're a
Really Smart Person.

--
Greg

RE: on writing a while loop for rolling two dice

<mailman.662.1631064022.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19468&group=comp.lang.python#19468

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: avigross@verizon.net (Avi Gross)
Newsgroups: comp.lang.python
Subject: RE: on writing a while loop for rolling two dice
Date: Tue, 7 Sep 2021 21:20:13 -0400
Lines: 47
Message-ID: <mailman.662.1631064022.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de uL7IYApM8Y1kEgSPZ62nrwJVxC3PPsUENJ0pTcsrj9lQ==
Return-Path: <avigross@verizon.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=verizon.net header.i=@verizon.net header.b=Z/kMqPXz;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.007
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'loop': 0.07; 'view,':
0.07; 'url:mailman': 0.09; 'difficult.': 0.09; 'resemble': 0.09;
'subject:two': 0.09; 'tricks': 0.09; 'basic.': 0.16; 'endif':
0.16; 'expressions': 0.16; 'greg': 0.16; 'indentation': 0.16;
'received:(vzm hermes smtp server)': 0.16; 'subject:loop': 0.16;
'subject:while': 0.16; 'subject:writing': 0.16; 'utilities': 0.16;
'wrote:': 0.16; 'url:listinfo': 0.16; 'grant': 0.17; 'url-
ip:188.166.95.178/32': 0.20; 'url-ip:188.166.95/24': 0.20;
'programming': 0.21; 'python,': 0.21; 'language': 0.22; 'version':
0.22; 'url-ip:188.166/16': 0.23; 'languages': 0.23; 'creation':
0.23; 'object': 0.23; 'to:addr:python-list': 0.23; 'code': 0.24;
'written': 0.24; 'seems': 0.26; 'skip:- 10': 0.26; 'port': 0.27;
'else': 0.27; 'bit': 0.28; 'old': 0.28; 'url-ip:188/8': 0.29;
'but': 0.31; 'am,': 0.31; 'fact': 0.31; 'guess': 0.32; 'python-
list': 0.32; 'using': 0.33; 'header:In-Reply-To:1': 0.33;
'subject:for': 0.33; 'words': 0.35; 'yes,': 0.35; 'trying': 0.36;
'two': 0.37; 'people': 0.37; 'really': 0.37; 'though': 0.38;
'to:2**1': 0.38; 'use': 0.38; 'someone': 0.39; 'enough': 0.40;
'to:': 0.62; 'back': 0.65; 're:': 0.65; 'smart': 0.68; 'and,':
0.69; 'received:74.6.130.42': 0.69;
'received:sonic308-3.consmr.mail.bf2.yahoo.com': 0.69; 'away':
0.70; 'games': 0.71; 'person.': 0.71; 'below': 0.71; 'sent:':
0.71; '2021': 0.84; 'macros': 0.84; 'grammar': 0.91; 'goals': 0.96
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1631064018; bh=gNFV+hA3S4SbFMwnn7wCWECOkA5vm2q2LSHYhP5+voY=;
h=From:To:References:In-Reply-To:Subject:Date:From:Subject:Reply-To;
b=Z/kMqPXzVciK7tJmYsk3FXIIK4ePavdkX7V9R64WpHHT8fXGA78SM7WAoaQpd5gl61zJ/3PHbGHpb3OBk1gLimr80SVc8q3yhu7uKKRJk0mhkCh4HwzZzSFwjGakNwV5s+Nfp37LlonNUFhR9zkc+Bi/YcYpktAshwoLbMvSLWbb0YzL604OJUjX37vAypcoaObZwWQcGC5g8zOqz36t3nhAF/Pjp84wkz1MifmQZptEuxWQnSl+xLZJQk4see1u2etcJjuPhQTlQPW8DIiY1IeJ3aPcyA8Jcx9VtTEIbnRZk+qQbTVQNpNc30RGRLu2NfxoMhRY8mLI/d/mP1gobw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1631064018; bh=4YpJBa15qepdiKK9bYMpW3+v27KA5BPUkFX8fX/J6AI=;
h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
b=rlsfST87A7/JskAeWggQBwJ766ax3lYR6TebGMvWC57ULebBAL0k3TQgy0TXFRydHgE9WB8670ak5fqw+WIX0rkYv2Rc1x9FrLJMzhN9v31l4990Kvs6uNGa4cgL/tjrTE9CaAPOfe9b7NJkzJXuOMAkNgCCHYe23K/fVmgRO1f/nl+3xOrovk4vvFCyVhPE1K5Jtuydwi5+fdb5CW0g8tta/IpbUcq9mtkyiSGaiNIxB+pluzK67ZzSLl46BDBxNg/BAoxiTaZUpfCO6y7mS5TTpGf0MIKj8Et/ehXyp03OWGSnc/KXbuuK/AiaTCLWcSKnlj/4hdp9OPi2gqMlkA==
X-YMail-OSG: hjDsmaMVM1nYG_DILIcD8dN1i_IeG0UN4cyFfwl.bYeshb0AUNTcK1UhixrsVvm
oos1eizjhBnfhWY.gs3AIouS89o2aoPz0Xr2p4.t0ghZlJ9ImFOF3EZ1c9lbwg1A7l4jHqYJlAYg
Dn4ioNSEJZtYo6HS5lIgyMRCyU1iPO0U1J0dpOPBaxQnlqUSzi9VI6mxnSelgAoz.azgrfFqYPMK
5FHi6w68N.1DzjRqbCsiy6sVdholvBb2rU0tMLXfGOVFstmJKWtDP1uXOUXF.S4W33zxwJEZIyId
EMC70R5XEd7gyGoZBqTSK5HPyCrtiLIRC8Or20BqdsXDqsdMf7traIGh6cWHzBVjc95IaHh9UoNl
lgXGnyDXNjs3YHDQZi2DcZYMo7BRtjPGgtRef7CZM26GlIP99cz3Hv1G2jz8YweEZhIrC6wk4JAd
rsrN3QyxGafE1L4PVeCPpvL_9V6MaWxZuA6._W7KlG6Nr_5BXlD7RBNS6IU84w1WaFQDq8gCZSZT
WBPsRew0UhQhl.onVe8LT4omSm2LYLqc8WkNotqOhTGiG4HtHw1.8u4.ply8.ygH2iszz5p977JI
EHxRwY41WWNTVbNtGL0gOk4kSo7iDEP.l6rH3W0Qoh3wm4Zcv21wgoGK2ZR8H.rgWFGczkIFLpgK
.SEa5IzUSqGLqrsx1nXPo27xBDV4RFQ6bpAXlDnl7aXflz12GLlev0vxxxNvL5BkJHaLmWGjI7Vg
cjKLK4rsiKeHLwskN9hrj10mALouP5aIOIZlONWqP2p3kC4THqGgTigqYcV9DHRQ_2XpsErYji8o
DZAL.P_MqPieec2FFfZPPZG0UflOas9iyYQVFPsWP.pG70I5ElRVVaFKSEtALdeNK2SSjmtohqK9
XB_6zQAuNs8cnneP119IhTpJBumeICsftwUCARewHnbHGsiLqSDmX1vGeNDkz8kGsw_30cFNnO1y
dBPhtA3HnvxT8zb5ZqrIRXfJbojH9aFPT.3s3dzVVncrPC6HfxpoaFg8LZcd4ApwVKbter9PlGSS
giPX5LQRDyzzdr8cIxnzUI4RfRtmJMreihLJtlyjkByN9uxTEDKxY3WNLuGHEDMGYdgMu8J7wPt6
KuxRh4FNRfnp8R0LAQ4PN3HgFRHb7Cr7u5W22VYboV8D5iAGH8a.giMaySCNQILYB0QWfyGrTUfi
Ao9jdTC14GKs3ETha0NFtbnAV3glW0_STnsFwfHtSfhoWE3_sVo9GmS0THBVZqKHu_.kTwm7Pbb1
PRKDpBYONHD2XROk8J89BMdymrp3VkfN6Wy6iQSWvMYJQ6C9C62QpvwPBtLSvitZeJxV.w.1uRTA
EenzyZd3aKL5VOawnuvWCEGsa.vnHYwuZ7_jgwO4jWx_2xoor6Qww479zEjEs_PymIcvFXaMFbqf
aSoQvMbPGebHAhCWt.H8i1VgyG2baptm5d.FgJlMSh7n4_DJi9URxV2i8TC_deF2scrlUItMv0pG
fboKOajhANvz_SP7tCZT_B83UipBccbKXFAVxT4FFNOzlNQbr7qD7RyQWQqgcfq0wgwi_HZUfmEi
6yVttXkPxj1ge.t4K2EhOWhoAgBH17u3OEmkHHwDcCRjeqdfOKJEj_6TbKNXbO5Ui1qnl6WgIxIK
XVKQE6l0M_0itbAPE1RjHXceuQYub5xoOEyVQ5CENMEdfKUoee5h1_lhtrCScjPe96_ZuTd8s8Mw
6dwFxgbqzFI36kfv.3I34MgIviWLpmlh7.FNQ.XdMOR7jZLZspg7HlmhF8blET2vMGdu9xEAvuCS
o6KO.uGMFyKkidmSyMeTrMyYw.eTGle1gbzBQRHce_ywr1mWYF0QaZXUygidVSbPKm5A559zDiHa
n.RP.23drVvik3prub4dBZLRSWC1VrwyVUl7zjBgkNuH6gNirqAa77bpMcGWauKJ3lrQq2NejV5A
s73GrhknQWvp1M5qWhYKLlIhOqqH5GyqUTvH2N6UspPc5fQpiPNU5bPOKKkrR.4pB8.JzzqdCQ.e
1H.427P5mFOiKgmiPLiKWUFQt0bJj8loSK48B_CWemGcmH6qXbhcWGEarRQN4X1yYgIouBsnrzKD
4WZeGR9Kpct6609hA9z6rvTTLXpCyjwkM3deEkiv2x6sHxY1jjKv8vUzsoo8SwCT6ocqDDSb3GIh
32.W7uNJt4_bpkyNBcqJCI0nvwT3fAkk2HmIxQtJj1F3s.EwPLldLRnUbUfVz1ftydBbujWEhZUg
3b1bbHqKVe9qvv6V5aqRzZiwLdn8Z6UhwKnJzz87Y5PO7e0cTA5C1MoKkgRUuwaezsbzK2mh7H6x
sJwg3uXF1dch3Cg--
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <ipqgn3FqmbtU1@mid.individual.net>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQGJaWvPXwJqf5icjAQ/OktvdS4XLwJBtumuAlZstTgCr4ZatwIeFkQTAtV3ypUCEaxZ6wHru4+5An8MYx8CUvGXywJP3LIHAwzfw6kCKitWsAFDpYOjAmfXFDoCl2naMwGhMahwqxIdnQA=
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <018401d7a44f$accc70d0$06655270$@verizon.net>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
 by: Avi Gross - Wed, 8 Sep 2021 01:20 UTC

Greg,

Yes, a smart person may come up with such tricks but a really smart person,
in my view, adjusts. With some exceptions, such as when trying to port
existing code to a new language quickly, someone who is not too obsessive
will try to pick up the goals and spirit of a new language and use them when
it seems reasonable. And, a smart person, if they see nothing new, might
just go back to their old language or ...

Pick a language that easily supports regular expressions and object creation
and functional programming and so on, like python, and ask why you might
want to use it to simulate a really old version of BASIC when you can just
use BASIC.

Admittedly, most people are not flexible. I find that with human languages
too that some learn another language just enough to recognize words but not
to use the changed grammar or the different idioms and never become fluent.

I am amused though at the fact that python, by using indentation rather than
things like curly braces, would make some of the games like shown below
quite a bit more difficult.

-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net@python.org> On
Behalf Of Greg Ewing
Sent: Tuesday, September 7, 2021 9:08 PM
To: python-list@python.org
Subject: Re: on writing a while loop for rolling two dice

On 8/09/21 2:53 am, Grant Edwards wrote:
> #define IF if (
> #define THEN ) {
> #define ELSE } else {
> #define ENDIF }
> ...

I gather that early versions of some of the Unix utilities were written by
someone who liked using macros to make C resemble Algol.

I guess you can get away with that sort of thing if you're a Really Smart
Person.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Re: on writing a while loop for rolling two dice

<mailman.663.1631066928.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19469&group=comp.lang.python#19469

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Richard@Damon-Family.org (Richard Damon)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Tue, 7 Sep 2021 22:08:43 -0400
Lines: 24
Message-ID: <mailman.663.1631066928.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<sh8co8$1p2n$1@gioia.aioe.org> <05c601d7a421$cc45c700$64d15500$@verizon.net>
<ece4b5f4-8e1e-2195-397e-aa663ba21082@Damon-Family.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de gNoz2LuVUCHhOetV/gcJcAPJFj6ybfoKo6JopGOwIGzw==
Return-Path: <Richard@Damon-Family.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'fairly': 0.05; 'issue.':
0.05; 'modules': 0.07; 'damon': 0.09; 'functions,': 0.09;
'namespace': 0.09; 'point,': 0.09; 'subject:two': 0.09; 'timing':
0.09; 'received:173': 0.11; 'import': 0.14; 'avi': 0.16;
'detecting': 0.16; 'from:addr:damon-family.org': 0.16;
'from:addr:richard': 0.16; 'from:name:richard damon': 0.16;
'gross': 0.16; 'message-id:@Damon-Family.org': 0.16; 'module,':
0.16; 'received:74.208.4.194': 0.16; 'remember,': 0.16;
'subject:loop': 0.16; 'subject:while': 0.16; 'subject:writing':
0.16; 'things,': 0.16; 'wrote:': 0.16; 'maybe': 0.20; 'pm,': 0.20;
'basically': 0.23; 'behavior': 0.23; 'object': 0.23; 'to:addr
:python-list': 0.23; 'actual': 0.24; 'function': 0.28; 'module':
0.28; 'header:User-Agent:1': 0.31; 'but': 0.31; 'difference':
0.32; 'objects': 0.32; 'python-list': 0.32; 'header:In-Reply-
To:1': 0.33; 'subject:for': 0.33; 'program.': 0.35; 'cases': 0.37;
'changes': 0.37; 'change': 0.37; 'something': 0.38; 'fun': 0.60;
'reference': 0.61; 'likely': 0.61; 'order': 0.68; 'exactly': 0.69;
'global': 0.72; 'change,': 0.77; 'danger': 0.84; 'will.': 0.91
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
Gecko/20100101 Thunderbird/78.13.0
In-Reply-To: <05c601d7a421$cc45c700$64d15500$@verizon.net>
Content-Language: en-US
X-Provags-ID: V03:K1:3sCzmDb7u/OuX3/I9ktCAeO2VTpysMlmYpOkrXd8SE6kGJ0i3h+
fpQRtpK0+DnqNdjEhNWMYdWV6TydoopUNTFExqmtp7cpqA4NIrtHAJKNyiEKyZcZk418Wrk
TCVQQe3/dxjCDuuxDocH1/0MqMeSb3kzCV6k7TPDolGQhi77zHsw0gyVKth8mKHQKnD67ay
ahqhY6i2JRUmkog6TmILQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:PIJxvII2SJY=:ryg58VnMJ1bfXrBahuPj9i
I6co3muNZDGkKCOqwbFr1yUoTIhkAsS7Db3Uuo+Ty2csKFxR1ZX5DtpOrdqfyWS4LiFd5lUHD
mEf/CWSEl+nJ9kbqpe+8XEjKhWspJy0vS3QgGLLPfsPn38UvaAv29Xkj2r9cj20QT3FRgPrGe
WCGqPgkGCkGNo1PEYOqGY0XcG4KjxAowkybKfZYaDFejVK01sco2tYjhmYHx9C5ow10aQvxiM
UGU8pulMehS5IMII2xiEStPYAZ1hBH0J5qkBfsFTSwlnOQIyxFIGi/zy9Hpgp1+O+0bRCqHpz
XNqjvJhpowoiRNZ/6Wtb+aDjBzVCtExZ4e4eQwOlgfK5imwn1inCziyN7D8WgJsIB/wDtNmz5
QvVcoL1grpZh3F/y6H0f/z8ccVNvt15GZ/KRNnV6Jc2HhbJDF4qwXDDwHf2TIBdIzRuHcmqk2
Go6107nN3YYAFtoKRJJW2lX8zvCl3FqidCjreVmW1b6d8a5bm7stBN2lg4JCoqX7C7LIGwIzz
zCACBnLoJssGuQvmZFCyZ6HATfVAEuNSGt9WcepFK1bj7KhdFEm0aaZqXsbjw7SU4JOs2h8ak
FiR4SaVYD88hTaP4OdBJzhkSlYws92x6zIXmXeFGQwS3+sO0g6pRQ1A9ANMS77EGEgCnWbJzS
odGYezR7Rs4WwBj0np1ohgHUkgiv0wUGrf5+B29obBDwxy0cS/qohcdCZqMtEjtj4xNUGwe88
xFEAwLNyH3MZ3oCgpJ8xqHYEBS3n9BtIhFVhtTkhTLe3u26BM+ZaWSHUrno=
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <ece4b5f4-8e1e-2195-397e-aa663ba21082@Damon-Family.org>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<sh8co8$1p2n$1@gioia.aioe.org> <05c601d7a421$cc45c700$64d15500$@verizon.net>
 by: Richard Damon - Wed, 8 Sep 2021 02:08 UTC

On 9/7/21 3:51 PM, Avi Gross via Python-list wrote:
> and similarly changes any function imported directly
> to also be fully qualified.

One danger with this is that it can actual change the behavior of the
program. Maybe more likely with global objects than functions, but still
an issue.

Remember, "from module import fun" will bind the name fun in this
modules namespace to the current definiton of the object fun in the
other modules name space. If after that point, something rebinds the
name in the other module, the module that did the from import won't see
that change, but if the reference is changed to module.fun, it will.

Since that rebinding might even be some third module doing a 'monkey
patch', detecting if it is safe is basically impossible.

Admittedly, if this is an issue, the sensitivity to timing makes the
difference something very fussy to exactly the order you do things, the
cases where the difference is intended is likely fairly small.

--
Richard Damon

Re: on writing a while loop for rolling two dice

<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19470&group=comp.lang.python#19470

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 07 Sep 2021 22:31:27 -0500
Subject: Re: on writing a while loop for rolling two dice
Newsgroups: comp.lang.python
References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
From: chottel@earthlink.net (charles hottel)
Date: Tue, 7 Sep 2021 23:31:27 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <mailman.662.1631064022.4164.python-list@python.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Message-ID: <StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>
Lines: 52
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 100.15.117.46
X-Trace: sv3-mH0i9ZsCJpK4dxmP0OxnKx7TaI5iQY4C6kDzkOmyxDMt6QfRZDCQYBrAJLKEsnfqMgxuc672M7OJDsm!RhvrQ2ecGRQhQ1ZoDHdQ9AuVWv+fH+1kSPImvv2+fSKhD2Gc6ZZ8tEaVpmbyZ4u/JXfUUmSYpwNs!wJRpGT/W7x7xcA==
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 4111
 by: charles hottel - Wed, 8 Sep 2021 03:31 UTC

On 9/7/2021 9:20 PM, Avi Gross wrote:
> Greg,
>
> Yes, a smart person may come up with such tricks but a really smart person,
> in my view, adjusts. With some exceptions, such as when trying to port
> existing code to a new language quickly, someone who is not too obsessive
> will try to pick up the goals and spirit of a new language and use them when
> it seems reasonable. And, a smart person, if they see nothing new, might
> just go back to their old language or ...
>
> Pick a language that easily supports regular expressions and object creation
> and functional programming and so on, like python, and ask why you might
> want to use it to simulate a really old version of BASIC when you can just
> use BASIC.
>
> Admittedly, most people are not flexible. I find that with human languages
> too that some learn another language just enough to recognize words but not
> to use the changed grammar or the different idioms and never become fluent.
>
> I am amused though at the fact that python, by using indentation rather than
> things like curly braces, would make some of the games like shown below
> quite a bit more difficult.
>
> -----Original Message-----
> From: Python-list <python-list-bounces+avigross=verizon.net@python.org> On
> Behalf Of Greg Ewing
> Sent: Tuesday, September 7, 2021 9:08 PM
> To: python-list@python.org
> Subject: Re: on writing a while loop for rolling two dice
>
> On 8/09/21 2:53 am, Grant Edwards wrote:
>> #define IF if (
>> #define THEN ) {
>> #define ELSE } else {
>> #define ENDIF }
>> ...
>
> I gather that early versions of some of the Unix utilities were written by
> someone who liked using macros to make C resemble Algol.
>
> I guess you can get away with that sort of thing if you're a Really Smart
> Person.
>
> --
> Greg
> --
> https://mail.python.org/mailman/listinfo/python-list
>

So what do yoy think or feel about a language like RATFOR (Rational
FORTRAN) which was implemented as macros? Should they instead have
simply adapted themselves to FORTRAN?

RE: on writing a while loop for rolling two dice

<mailman.664.1631074356.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19471&group=comp.lang.python#19471

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: avigross@verizon.net (Avi Gross)
Newsgroups: comp.lang.python
Subject: RE: on writing a while loop for rolling two dice
Date: Wed, 8 Sep 2021 00:12:29 -0400
Lines: 74
Message-ID: <mailman.664.1631074356.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<sh8co8$1p2n$1@gioia.aioe.org> <05c601d7a421$cc45c700$64d15500$@verizon.net>
<ece4b5f4-8e1e-2195-397e-aa663ba21082@Damon-Family.org>
<01a401d7a467$bdbb3b70$3931b250$@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de V556SJie+Hj8JgZwsS2LwQ/LPmXU1A37sZYZiqMsBatQ==
Return-Path: <avigross@verizon.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=verizon.net header.i=@verizon.net header.b=olIfyde1;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'fairly': 0.05; 'issue.':
0.05; 'searching': 0.05; 'explicitly': 0.07; 'language,': 0.07;
'loop': 0.07; 'modules': 0.07; 'url:mailman': 0.09; 'damon': 0.09;
'functions,': 0.09; 'meant': 0.09; 'namespace': 0.09; 'point,':
0.09; 'subject:two': 0.09; 'timing': 0.09; 'import': 0.14;
'problem.': 0.14; '10:09': 0.16; 'avi': 0.16; 'cases,': 0.16;
'detecting': 0.16; 'gross': 0.16; 'indeed': 0.16; 'interesting,':
0.16; 'module,': 0.16; 'not)': 0.16; 'received:(vzm hermes smtp
server)': 0.16; 'remember,': 0.16; 'runtime': 0.16; 'simulation':
0.16; 'static': 0.16; 'subject:loop': 0.16; 'subject:while': 0.16;
'subject:writing': 0.16; 'things,': 0.16; 'undo': 0.16; 'wrote:':
0.16; 'url:listinfo': 0.16; 'bug': 0.20; 'maybe': 0.20; 'name.':
0.20; 'pm,': 0.20; 'url-ip:188.166.95.178/32': 0.20; 'url-
ip:188.166.95/24': 0.20; 'python,': 0.21; 'language': 0.22; 'url-
ip:188.166/16': 0.23; 'basically': 0.23; 'behavior': 0.23;
'object': 0.23; 'to:addr:python-list': 0.23; 'actual': 0.24;
'discussion': 0.24; 'lines': 0.24; 'code': 0.24; 'computer': 0.26;
'skip:- 10': 0.26; 'wrong': 0.27; 'function': 0.28; 'module':
0.28; 'error': 0.28; 'url-ip:188/8': 0.29; 'there': 0.31; 'think':
0.31; 'packages': 0.31; 'but': 0.31; 'explain': 0.31; 'question':
0.32; 'difference': 0.32; 'objects': 0.32; 'python-list': 0.32;
'structure': 0.32; 'program': 0.33; 'header:In-Reply-To:1': 0.33;
'subject:for': 0.33; 'functions': 0.34; 'hold': 0.34; 'same':
0.34; 'program.': 0.35; 'cases': 0.37; 'possibly': 0.37; 'two':
0.37; 'changes': 0.37; 'way': 0.37; 'change': 0.37; 'something':
0.38; 'does': 0.38; 'means': 0.40; 'called': 0.40; 'package':
0.40; 'common': 0.60; 'fun': 0.60; 'reference': 0.61; 'covered':
0.61; 'generally': 0.61; 'likely': 0.61; 'paid': 0.61; 'to:':
0.62; 'your': 0.64; 'his': 0.65; 'back': 0.65; 're:': 0.65;
'full': 0.68; 'order': 0.68; 'within': 0.68; 'exactly': 0.69;
'excel': 0.69; 'interpreted': 0.69; 'manner': 0.69; 'skip:e 20':
0.70; 'sent:': 0.71; 'global': 0.72; 'attention': 0.74; 'tools':
0.75; 'name,': 0.75; 'change,': 0.77; 'documented': 0.77;
'guarantee': 0.77; 'qualified': 0.77; 'effective': 0.80; '2021':
0.84; 'accurate.': 0.84; 'compatible.': 0.84; 'danger': 0.84;
'want.': 0.84; 'flexible': 0.91; 'will.': 0.91; 'agreed': 0.95;
'hidden': 0.95; 'turned': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1631074353; bh=vhUQKnFJLdcZeS/uy8c4740r0N+IhfjcHvchp0OujBY=;
h=From:To:References:In-Reply-To:Subject:Date:From:Subject:Reply-To;
b=olIfyde1LhVjJSfqZwUmQwZdKzzP8RYWOipOZsN9MGjtWuG3rB69YOjLVQELUpgo/s5GfNTDFxmqN1zFZdw7yWhsUkv0vOW6XytgHiMa7vAqHbqJQTrTr1WGMS1YQzl8GqCDxtR/msw8CzjNsXZvW1zhqNWD8EePopqv8WKT8PC6wKUiLh6wRRblw6/2B1tLT7i/q/9qC57QgGytA4VmJGRAEJU+gT6un0DP5kGvJ9H2JVW+a0ZgbjOmEa+nDLgbZugGlfSt6vkRNbbEiUB0b2okyW1beQaZT8yK7DSnUgrITmO6m9mlNRFDsJoIbwKRp4k2w2ds4DiasWDpnwFVoQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1631074353; bh=bRX1W036f9ILNlN5AZ9fHFiBMaR9EwA3xMe70FBTV0L=;
h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
b=aY286bA2ne0KP1c83VbysQweYOv5tS380BBpHP31l+SkaRmMqXr1f1wbNqfW360IfattZljqedUTMqLeDAHBLFsAtTooql2JHCgCxDgeHb4Qg+irVzL3hOZGjHRwYg7o5AHVGVyHw2gA4tCI7LhNAkcn/6GEZ02gIK8zIrnpdiM0RWBIFcQnQJ66qwnsat/2WB10tYr1Y/UfM0kKBD6ajnE4xPFXKzAZeDqZozLyh160tp7rYAaml8N7WwaJ51D4p7sgalszm08nvZrSpp0daTAXc4/2gqybFHN05nLkMyCEj1RsfVb5Rk9UgEh+p8x3tmPY14QHpa79+Nuo8kj1NA==
X-YMail-OSG: Jwv5ZPIVM1ne_Oqu01GFb3EYXPrMaHtyK5YMQ8o4nre50oO2t6w9U4py2wUvRqL
rstYaFCau_tmP.AzJcu3dONR4bbzrHk6ghrFuL23IqloYle7PeuSXjaC.YC6MQ09w.FMmIuheB2s
DUvj8UcrZrrNcUPaCWB5.yB9ZlaOS1LRHUNUDOq5nCmk9lIDS4S38LgnpbURnEt4ghUkDderzLXA
XAi4ojcwY3dNFuZhE40awZvVPwoMF.bGBvuyC50jGk.68WNdLlJpCd5jp6QyyrKi2GwFycM4BYPN
Lhb8M4x9LKaoVxuYGfJrQ.sN3zaoa04Wyc.nawJJaaMZ01jDaFoHQm3aXWeNLGSPMAP4ffK6nVIj
66luqpgwRvyjX5jG__CxsKOx8w5gVTkJfjFNsyPpiVZJgRaenJxnypFf692Veoe8e4UNkFuM5vvn
0_7OtNoTwT4TGw7ahq2IEXdrg0w6p2vnXScXSgqRYTRWKXPkdZmpMzlUIjsmu0HGOENc9Jk2hRJy
THcWx_tp91IjxTP1XthVKAHhS7SMtthOo2P78t.wtCZ_6sq8l9JDM0lCPsREw3Im4EoOoXQvhTr1
Ln8RCnzloaPyNaCkmMG5fUYViUojo11QEY.4u09eKqOz46kMv02eImX0nZnyrQmjkHQMc3qHMFnj
VpvlDFkXehp05qgjlWmJapsGmkb06ltQnPuLGAoJy6xs8QBysvV.0i2q2zjC98IzgpppCa7d1hcQ
Yt52vrYO6iTU9RJ6.3pYG0lvJROCvOsxH6.sAWt0gqslQQe44.0vkd8hI8jUZ_3TmwWH7L35Fi8Z
6jdFXTKsCIXaS2xgpkaRIKTy0lSbbtd0peYVbIpBONsjeE0yc0_dNK_2tSlSXGoGSiei2CPuMBHh
puUn8wleYdFJ0x2dHo1wxQWxuQxVXbo.tHX0OiS1b5h5_BrotHzgMwVKTPLiOKsFsXBl4JAg7O.I
O0jph_R_3nbLp4XU8QeyVYTxndBeyQDhx2yZEZIqDqB04ckwlmzHMwEYCWmuk9qczgtYWXOJdi_h
GAJ2qEZaJpBWig4aR43aTCdAe_IWn0bRwsuFHaLijgWxcVC.QfTrwcpuks6GCOBpmQUqWlq4Dlk.
zrT3VkfiLUGhfLwpAWXhukmqCyf9XpnqiU6WYmScvxtueyMByu5sxgZaVHEl0zOKcodjuta1G4xS
2O78F.JLr7PYQrGiLUzP8fxfU75v3deUlYbvskSdwN.JM22T4be3C5xiAwrntr6jR211yw8n.07n
VaUaFumXy5RXLm9_MW0yRpWTllqEVuhpEw3uo_o94.DfxY6_LI9Rb7uvNPNjanL9_XUuBikge8a7
NDAyy.IUWKXejvimQR.CJHJQyazKEHMDuU8iQxqmN6TmvN1Lyw1onQtWcCjnz_RQ683amP0vmqvU
1wgbcTEaU6oG0dfY2VqlD3OJy7ONa.hGVbxHQSe7opB4NnNn6lIiDtdfbjoUIYmvBWowNqfv9e20
DV.KRIxysLy0iHrRMr_myANwHNqjuMXPZdqQgCGP8atQUaDP7fmbaOPDpVp6oVqT03lcdXkIb5Yl
3y58XQCdRU8K6VHSdT58I85N4TlViOa36GfyLA.cNuWXx3iqlgyPu8bfYqYGnhwZGjYJHa6Svg.8
goOboNvuJmrKGz.VrH2cW4Jl24A9lozwXlUohSKHXb3jpVNfRpt1h94DnN2tYdFhEqBIzqFiCdhI
g6XCN2Xf51AflhguHtg3pNUr8r.031qKq3wzj22nZcCAgYjs.kqg37yoDBc.e7RfKBipr_46R8ba
06yzsC60kItv_gSqJQJnr4IsccAAcCZtK0WgMa.hrIaRUwb3WWaRv0.tqJb8Jwuh4OC6kUXWDoCe
QUQYyQL3nnd10ck9KqODBZ7Q2dktj6ma49UOA18KsKabplOoE9KtzhVjpOIhvI3ATPhFC4thYD_h
mGaZb7TjaIyhnE8Z3p_Q8tjueDlcqc4YXByrAAigxuYz6wGALTNFctFqPWBk.EfPkKCOnyQghaK_
CuuBk4A6BOMqC_90dvHjNIDXmB9X_ALRLZXEN5XbbWiWGkDpoq4THRpO2KzTFrlvPoxx3e3mTW_R
hDT7kLGf_VSRy9p5lRgVK_BgzWzLkElHttcvK..SxoQQxffQ1wktuQiU.uTJw3e2NfNz2MXjdrQN
tHQKQw09hFKiTMzZrL.DpV2C7DiDC5Ku0ATsqclbQZd_2JpeefGJx_TicpvpPCsm6ZyOSQbIZNQr
AeobKgkTY7Rg-
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <ece4b5f4-8e1e-2195-397e-aa663ba21082@Damon-Family.org>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQGJaWvPXwJqf5icjAQ/OktvdS4XLwJBtumuAlZstTgCr4ZatwIeFkQTAtV3ypUCEaxZ6wHru4+5An8MYx8CUvGXywJP3LIHAwzfw6kCKitWsAFDpYOjAmfXFDoCl2naMwIv3yfKAR/jvAUCZ/8zb6rxl4Gg
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <01a401d7a467$bdbb3b70$3931b250$@verizon.net>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<sh8co8$1p2n$1@gioia.aioe.org> <05c601d7a421$cc45c700$64d15500$@verizon.net>
<ece4b5f4-8e1e-2195-397e-aa663ba21082@Damon-Family.org>
 by: Avi Gross - Wed, 8 Sep 2021 04:12 UTC

I think I already agreed with much of your point. That is indeed the
problem. You are allowed to do some possibly non-standard things. A static
evaluation/replacement may show the wrong function being called and a
dynamic one may still mess up as there are many ways to do indirection.

I mention this partially because of a recent discussion on another computer
where the question was why they got an error message that the object being
given a function was not a data.frame or something compatible. What was
being passed was a data structure meant to hold some simulation of an EXCEL
spreadsheet. Not quite the same. But they insisted it had to be a data.frame
because they called functionA() and it is documented to return a data.frame.

It turned out that they had loaded lots of packages (modules but not) and
had not paid attention when they got a message that one function called
functionA was now being covered by another with the same name. Each such
package loaded often gets a new namespace/environment and when searching for
a function by name, the new package was ahead of the older package, hence
the warning.

So one solution was to change his code in one of several ways, but more
generally to call any functions that may be hidden this way in a fully
qualified manner as in packageA::functionA(...) do you do not accidentally
get package::functionA(...)

Now note this is not so much a bug as a feature in that language and It is
quite common to sort of redefine a function name to do what you want.

But if you have developed your own package and want to guarantee the user
does not undo your work in specific cases, you should also call some things
as explicitly within your own namespace.

Back to Python, it is a tad too flexible in some places and my point was
that it would be interesting, along the lines of a linter, to have some
tools that help explain what the program might be doing a tad more
explicitly. But as an interpreted language, so much can happen at runtime
that this may not be very effective or accurate. The language is full of
places where slipping in another object means you over-rode the meaning of
+= for instance.

-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net@python.org> On
Behalf Of Richard Damon
Sent: Tuesday, September 7, 2021 10:09 PM
To: python-list@python.org
Subject: Re: on writing a while loop for rolling two dice

On 9/7/21 3:51 PM, Avi Gross via Python-list wrote:
> and similarly changes any function imported directly to also be fully
> qualified.

One danger with this is that it can actual change the behavior of the
program. Maybe more likely with global objects than functions, but still an
issue.

Remember, "from module import fun" will bind the name fun in this modules
namespace to the current definiton of the object fun in the other modules
name space. If after that point, something rebinds the name in the other
module, the module that did the from import won't see that change, but if
the reference is changed to module.fun, it will.

Since that rebinding might even be some third module doing a 'monkey patch',
detecting if it is safe is basically impossible.

Admittedly, if this is an issue, the sensitivity to timing makes the
difference something very fussy to exactly the order you do things, the
cases where the difference is intended is likely fairly small.

--
Richard Damon

--
https://mail.python.org/mailman/listinfo/python-list

Re: on writing a while loop for rolling two dice

<mailman.665.1631112872.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19474&group=comp.lang.python#19474

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b.edwards@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Wed, 8 Sep 2021 14:46:28 -0000 (UTC)
Lines: 21
Message-ID: <mailman.665.1631112872.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>
<shaic4$b76$1@ciao.gmane.io>
X-Trace: news.uni-berlin.de 0w7VpdU0FSzMM0W6+tk2agEXNYXMElSAR4CDDctkQPdw==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(e.g.': 0.04;
'underlying': 0.07; 'message-id:@ciao.gmane.io': 0.09;
'received:ciao.gmane.io': 0.09; 'received:gmane.io': 0.09;
'received:list': 0.09; 'subject:two': 0.09; 'abstraction': 0.16;
'complete,': 0.16; 'from:addr:grant.b.edwards': 0.16;
'from:name:grant edwards': 0.16; 'received:116.202': 0.16;
'received:116.202.254': 0.16; 'received:116.202.254.214': 0.16;
'subject:loop': 0.16; 'subject:while': 0.16; 'subject:writing':
0.16; 'wrote:': 0.16; 'grant': 0.17; 'instead': 0.17; 'language':
0.22; 'to:addr:python-list': 0.23; 'anything': 0.24; 'seems':
0.26; 'header:User-Agent:1': 0.31; 'think': 0.31; 'question.':
0.31; 'subject:for': 0.33; 'from:addr:gmail.com': 0.35; "that's":
0.37; "it's": 0.38; 'source': 0.38; 'enough': 0.40; 'skip:q 10':
0.40; 'skip:w 10': 0.61; 'feel': 0.61; 'simply': 0.62;
'providing': 0.64; 'look': 0.66; 'similar': 0.66; 'implemented':
0.69; 'translated': 0.69; 'received:116': 0.71; 'interesting':
0.71; 'macros': 0.84
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: slrn/1.0.3 (Linux)
X-Mailman-Approved-At: Wed, 08 Sep 2021 10:54:31 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <shaic4$b76$1@ciao.gmane.io>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>
 by: Grant Edwards - Wed, 8 Sep 2021 14:46 UTC

On 2021-09-08, charles hottel <chottel@earthlink.net> wrote:

> So what do yoy think or feel about a language like RATFOR (Rational
> FORTRAN) which was implemented as macros? Should they instead have
> simply adapted themselves to FORTRAN?

That's an interesting question. If the langauge is complete,
well-defined, and well-documented then it's not that much different
than any other source language than gets translated into a lower level
language (e.g. C -> assembly). My recollection of RATFOR was that it
provided enough signifcant "features" that weren't available in the
underlying FORTRAN to make it worthwhile.

That seems to me to be qualitatively different than a set of macros
that simply make one language look (somewhat) like a different
language with a similar level of abstraction -- without providing
anything other than cosmetic changes.

--
Grant

Re: on writing a while loop for rolling two dice

<mailman.666.1631115400.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19475&group=comp.lang.python#19475

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b.edwards@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Wed, 8 Sep 2021 14:58:04 -0000 (UTC)
Lines: 14
Message-ID: <mailman.666.1631115400.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>
<shaj1s$qt6$1@ciao.gmane.io>
X-Trace: news.uni-berlin.de txiKhAvrjjaeinAllarImwMIehGIdxwj+tW1dmE8WLtw==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'compiler': 0.09; 'message-
id:@ciao.gmane.io': 0.09; 'received:ciao.gmane.io': 0.09;
'received:gmane.io': 0.09; 'received:list': 0.09; 'subject:two':
0.09; 'yes.': 0.09; 'does,': 0.16; 'from:addr:grant.b.edwards':
0.16; 'from:name:grant edwards': 0.16; 'generates': 0.16;
'received:116.202': 0.16; 'received:116.202.254': 0.16;
'received:116.202.254.214': 0.16; 'structures': 0.16;
'subject:loop': 0.16; 'subject:while': 0.16; 'subject:writing':
0.16; 'whatever.': 0.16; 'wrote:': 0.16; 'instead': 0.17;
'generated': 0.20; "i've": 0.22; 'language': 0.22; 'to:addr
:python-list': 0.23; 'code': 0.24; 'done': 0.28; 'header:User-
Agent:1': 0.31; 'think': 0.31; 'but': 0.31; 'using': 0.33;
'subject:for': 0.33; 'from:addr:gmail.com': 0.35; 'way': 0.37;
'though': 0.38; 'source': 0.38; 'feel': 0.61; 'simply': 0.62;
'types': 0.63; 'seen': 0.65; 'assembly': 0.69; 'implemented':
0.69; 'received:116': 0.71
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: slrn/1.0.3 (Linux)
X-Mailman-Approved-At: Wed, 08 Sep 2021 11:36:39 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <shaj1s$qt6$1@ciao.gmane.io>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>
 by: Grant Edwards - Wed, 8 Sep 2021 14:58 UTC

On 2021-09-08, charles hottel <chottel@earthlink.net> wrote:

> So what do yoy think or feel about a language like RATFOR (Rational
> FORTRAN) which was implemented as macros?

The RATFOR implementations I've seen weren't done using macros. It was
a preprocessor, yes. But it generates code for the various structured
statement types (while, for, if/then/else) and source structures
(open/close brace) the way a compiler does, even though the generated
code is FORTRAN66 rather than assembly or bytecode or whatever.

> Should they instead have simply adapted themselves to FORTRAN?

Re: on writing a while loop for rolling two dice

<mailman.667.1631116313.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19476&group=comp.lang.python#19476

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: wlfraed@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Wed, 08 Sep 2021 11:46:55 -0400
Organization: IISS Elusive Unicorn
Lines: 36
Message-ID: <mailman.667.1631116313.4164.python-list@python.org>
References: <864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<sh8sbs$1684$1@ciao.gmane.io>
<k6mhjgh5rfk7q34ocjvfes061h109r8vpb@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de hHwXngvNnjnT0+Ac/z1MlAkfYy/49n9NnGcgG0Oc+3pg==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.015
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'apparently': 0.09;
'patches': 0.09; 'received:ciao.gmane.io': 0.09;
'received:gmane.io': 0.09; 'received:list': 0.09; 'smaller': 0.09;
'subject:two': 0.09; 'compiled': 0.16; 'decades,': 0.16; 'expose':
0.16; 'gauld': 0.16; 'goto': 0.16; 'if,': 0.16; 'message-
id:@4ax.com': 0.16; 'originated': 0.16; 'ported': 0.16;
'program"': 0.16; 'received:116.202': 0.16;
'received:116.202.254': 0.16; 'received:116.202.254.214': 0.16;
'rewrite': 0.16; 'separately': 0.16; 'subject:loop': 0.16;
'subject:while': 0.16; 'subject:writing': 0.16; 'while,': 0.16;
"i'd": 0.23; 'to:addr:python-list': 0.23; 'code': 0.24; 'written':
0.24; 'maintaining': 0.27; 'output': 0.28; 'header:User-Agent:1':
0.31; 'header:Organization:1': 0.31; 'shared': 0.31; 'wants':
0.31; 'python-list': 0.32; 'sep': 0.32; 'using': 0.33;
'subject:for': 0.33; 'close': 0.36; 'file': 0.38; 'those': 0.38;
'source': 0.38; 'enough': 0.40; 'could': 0.40; 'common': 0.60;
'per': 0.64; 'seen': 0.65; 'look': 0.66; 'years': 0.67; 'within':
0.68; 'implemented': 0.69; 'received:116': 0.71; 'easy': 0.75;
'late': 0.76; 'exposed': 0.77; 'left': 0.79; 'spent': 0.81;
'2021': 0.84; 'became': 0.84; 'comments,': 0.84; 'macro': 0.84;
'url-ip:76/8': 0.84; 'study': 0.89
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: ForteAgent/8.00.32.1272
X-Mailman-Approved-At: Wed, 08 Sep 2021 11:51:53 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <k6mhjgh5rfk7q34ocjvfes061h109r8vpb@4ax.com>
X-Mailman-Original-References: <864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<sh8sbs$1684$1@ciao.gmane.io>
 by: Dennis Lee Bieber - Wed, 8 Sep 2021 15:46 UTC

On Wed, 8 Sep 2021 00:24:44 +0100, Alan Gauld via Python-list
<python-list@python.org> declaimed the following:

>
>That was quite common in C before it became popular(early/mid 80s).
>I've seen Pascal, Algol and Coral macro sets in use.
>You could even download pre-written ones from various
>bulletin boards (remember them?!) for a while.

And if one wants to expose themselves to real horror -- look at the
output of one of those "structured FORTRAN" preprocessors (RATFOR, TEXTFOR,
others) that were cropping up in the late 70s to generate FORTRAN-IV from
code written with block IF, WHILE, etc.

I spent close to 20 years (80s-90s) maintaining the /output/ of such a
preprocessor. The software had apparently originated with a sub-contractor,
and we did not have access to their preprocessor (and/or no one ported it
to the VAX-11 from PDP-11).

At first my practice was to study a file in detail, and then rewrite it
using F77 with separately compiled subroutines (the preprocessor was "one
file per program" and implemented BASIC-style GOSUB, relying on shared
variables and ASSIGNed GOTO for the return address -- I had to move the
shared variables to COMMON blocks to make separate subroutines usable).

By the end of those decades, I'd been exposed to the preprocessor
enough to hand-write smaller patches within its style. The only good thing
is that is left the structured source as comments, and tended to
right-justify the F-IV output, so easy to locate...

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

RE: on writing a while loop for rolling two dice

<mailman.669.1631121882.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19478&group=comp.lang.python#19478

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: avigross@verizon.net (Avi Gross)
Newsgroups: comp.lang.python
Subject: RE: on writing a while loop for rolling two dice
Date: Wed, 8 Sep 2021 13:24:32 -0400
Lines: 51
Message-ID: <mailman.669.1631121882.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>
<0e7601d7a4d6$6395b070$2ac11150$@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de ebdFU/qIbEKCNQoP68aRmgNoWQDhPv9zSfxn97yCiKCQ==
Return-Path: <avigross@verizon.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=verizon.net header.i=@verizon.net header.b=ddOBzii5;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.043
X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'fairly': 0.05; 'clarify':
0.07; 'language,': 0.07; 'loop': 0.07; 'modules': 0.07;
'url:mailman': 0.09; 'alone.': 0.09; 'subject:two': 0.09;
'welcome,': 0.09; 'c++,': 0.16; 'contrasting': 0.16; 'languages.':
0.16; 'received:(vzm hermes smtp server)': 0.16;
'received:74.6.134': 0.16; 'received:74.6.134.123': 0.16;
'received:sonic315-13.consmr.mail.bf2.yahoo.com': 0.16;
'subject:loop': 0.16; 'subject:while': 0.16; 'subject:writing':
0.16; 'url:listinfo': 0.16; 'python': 0.16; 'instead': 0.17; 'url-
ip:188.166.95.178/32': 0.20; 'url-ip:188.166.95/24': 0.20;
'programming': 0.21; 'language': 0.22; 'url-ip:188.166/16': 0.23;
'languages': 0.23; 'doubt': 0.23; 'interface': 0.23; 'to:addr
:python-list': 0.23; 'discussion': 0.24; 'leave': 0.25;
'examples': 0.26; 'seems': 0.26; 'skip:- 10': 0.26; 'wrong': 0.27;
'bit': 0.28; 'environment': 0.28; 'old': 0.28; 'url-ip:188/8':
0.29; 'there': 0.31; 'think': 0.31; 'but': 0.31; 'discussions':
0.32; 'fine.': 0.32; 'guess': 0.32; 'language.': 0.32; 'negative':
0.32; 'python-list': 0.32; 'using': 0.33; 'header:In-Reply-To:1':
0.33; 'subject:for': 0.33; 'particular': 0.34; 'trying': 0.36;
'two': 0.37; 'people': 0.37; 'others': 0.38; 'use': 0.38;
'learning': 0.38; 'does': 0.38; 'someone': 0.39; 'forum': 0.61;
'feel': 0.61; 'experienced': 0.61; 'simply': 0.62; 'to:': 0.62;
'skip:b 10': 0.62; 'your': 0.64; 'experience': 0.64; 're:': 0.65;
'too.': 0.65; 'let': 0.65; 'parts': 0.66; 'look': 0.66; 'similar':
0.66; 'years': 0.67; 'within': 0.68; 'customize': 0.69; 'grown':
0.69; 'implemented': 0.69; 'increased': 0.69; 'away': 0.70;
'began': 0.71; 'sent:': 0.71; 'tool': 0.72; 'longer': 0.72;
'tools': 0.75; '2021': 0.84; '11:31': 0.84; 'benefits.': 0.84;
'compatible.': 0.84; 'purity.': 0.84; 'those,': 0.84; 'hidden':
0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1631121879; bh=VnVrdtNE+FmyXsaTIJI3XX2hfND6c3xtTMEZTi5vPMg=;
h=From:To:References:In-Reply-To:Subject:Date:From:Subject:Reply-To;
b=ddOBzii5v4RELU3XHscexHTMxSdP0tLDKnnoMaDiWYHyKd5PaNjPQrS7lebdSy95XzsIEGqaIl6ZRoKTV0Dn50H8oBBYqUjo1lHE+IiJt1Rc4lCkuVP4L6t9hXtvnAolfoLFw+Ux6mPNf2VwbI6vR4DIylikwJsGM3ArYRZ+feDWkPQHLSOsR/BtduLbQLEs3wkHVxNsk+dGnsOX9+4pwbaZ8Jk0XiHfa7qmRLrZy8YhkPs08BCGoW4+SLdy6Sd+bs3z/DtEwaJeN14ZDEDTiofaiLfDS6bvd86n7eZ0WeAvNoV4Y5hVE31731AzGTV5CI5QuVv4qIBVBzF6aocviw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1631121879; bh=nC2f1eg0OtopQrMNbBqwlVzC1DpRwEIqRRWTwyF/zqS=;
h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
b=IRwXw/u0rOOBVORtAfE9avjjJcT03VMxU41tMGjE3Cue0RMZAY25k9LW3F3OzgQuH8u2SeIKVh80Cyoh0LUYGYIv9DJL32/WnKdOCj8bhqUzaMp31KTXL+ur43gsF6C/8n8oU2w0zoa8QV9ieSbcRBacE1CCPFF7btNkg2O+IQUy3Wsv/vnJmSQ33tuxcCgOc3rtzyithsKLbmTRF5+KwjDKwxPHzSkEy1KC4337akW4eLwqFLDtiPnNS1tqM+wG18uL4EcAUwkxnntNrO6RfBKXbd8L85x1KlaU5/Q7nYDzgQ5qFGyGU7ZxZ4tUl1twb89XdWmdxGYcIqC8tJaMtw==
X-YMail-OSG: HR1gIvgVM1maLkxJf9uBfKOPoQ_Bhy70bpW4ldzkC5O0kngdvP_zCmoBV7nx1ic
IKgpoFCatlP7aa2KajArrXAkBai1qC8yO3SPectDZVDOlOOLi6iNuuHBN55_DPjg5e8FkwFdcs5B
sVhVk4XZ3ip0hUmwK.hxYqndSOymuD4XyuaTila26iROTELugTNAikNTl2PLHrPxC7ElhsCIlW80
P0XJ._KP3QVk1al8GmES1qg9VOM3BPBbCxFrMXEnQ52EpTjIYKtQiINdANUsJ67Asc0rKlqGeehI
E5nzLmB4YlymovUQkkPDiq7BMgeNlINxlo6JAvBy5PjrL9edkh4VIuvXy21MdnAFX5_j1cgJWz60
1MlV0LRQkXAxcoMnDqt5WPC_LnofQsuF_Z8QFIkqcVlIcCNh92BCjRjDIkY38kiqUWMsgNoAFAQO
.XJIs_aXwPSxOFNNZTn3KC9IFrNFeBlq81bmpWVe.PBkoUxkvbJ8hsRM6yPNtPz15qeVvaCAE.7V
zEGgkHnIUeKt2hNV5XmkckJ9h1GPFLXYziyTDJFir7XKQ_udpcvuhtUGxHcCIyZWp_ypha5atlyi
d9w8BIyKk8uvl8gDGHqhQL1CbEM3N4DngFjhhR4hIZfGpQRY1HtPuIil71IXNx5yXbiOCytHmqxL
v8TLC2fcvqz1AlfWoOhlAahfCoZNniVQL4PzSZJgKXXmIRCM7DP_xOw33ofb7qN7eXo2mrW_7MLX
BJpoTIBwX4HfCQDb.z14DF0x7h2yMMRy9cIGmUCb_5tJYDFRR_3ge4taZ96vbjZKcldpXqZWLikt
stVX9yviTRy9zHEr8GLPwwe01WCgMaBFaLvACi_HOuRMktuwT.2ib_fPHkwQSKgF88SuzXT95eKQ
sY81Hk_9oZrtM2w8Wcqw1gRJmO9hqAEB4tWS8vq54FWL0rpOnXXgO6_uUgz6FznhcAUZ8jA81Krz
jLrURBlIdQ.xFJFQj03GVhrOoRJqjkkjWVsVg0BBtp.3wMPxzCjnJ777AdRs_J6K8HzctdkC2a1U
rB5SMdKzK6IhFDetlmfayasr95ihMpZrYsIurliFU3dH_w7Yxa.Mj6TCn9a2M9YeeRKQ5LOS3DlX
L1ZsJeqbJtQ2pS4rUD0vYsAZ8oofLhbvIlIg_8iTI7MR1pK3ag8RUKFoHIKZx7e8LEE4EJ77MpyC
_0yC9K_uhh9tmyHSDTw0isGF_X6sJhXutPOqdW88d2VXtn0VWRCb9rB5G_zu1jgz1YUFhqHU2mUZ
xAXQtiZ76dL.Vdl6e3GOybItqrId.qgns2br9Uoj6oy.ZvdKzHaR164Ywp8ilu5q7_ZfBUUlOrmt
gBj6rpEtlydZ5Xe6dIWkxI4Xn8I43ibKeIjPYonPFrqzV_Un9E68qIAVdfmjFYVmEuk3Pr60.Vo9
tWnRB3vyS5sYH.aoaxCRi2215Jgq_pPeuwM4eV_BhwstOTg5tAaZONVwO5D4iiTEntAILxZSTWtx
kCBxks8SCtVnAJbgFkFDi4jf3cfRRs12jLyJUzFlPghZzclcdfkNHTqZJKbf8BQitiaW.W7lNPts
AvodXRjBwAD95Kp95j6UInB9F2PWbm63EE8qQtg1bIIujT3bWWyJZJOCavpfOcyW.eQ52IclC8wh
uia5S1lEbA3DlI9tTVmi5cDmicFy.AjtrBbmQT3oMCY88mesdv_MME0pe4h0WXZV.O8AVv_bgdeq
Q08TSQSQz8UVRbJaeaT06CYJ2If49E.TUzScc8vPcIQeKC37MiLutS.xTAqp1bpKz4b1AnfnsRvB
hv9g7TteJ9HScAONb11F1l3cRJtlzfOV8JdRBXDm7J2GzxlW0EFhWrbhSNqla8.heHutiNYOPUNB
f1SMEeEkPLN4LwIN00GyREMXVVAD.NwvLkjQz0I6hz4_XL5Dy97YVU1k.HWqvVj0EyqWxUVPaSYs
roklwFNrYTdyZ.V7NSXvfYCzNWcNzLMvEGNcxmF3CcFn.rW1jO7isvzOQ67xyk2VyLUzySOBDvAs
V42pkYOlRsiurV7l0jN5IiMDXa91DJ9zyNyVjLQp1Jjm5dZnasfW1W8KkjgAz6j6S9nuqAw5zt_y
mL4tOwabPUxJIG0KXRrXCZpyFLpVF2A8jP1OZL28cSoUlCmfV3vC9mmTbqbJy_kQwX9ss8UaHDR4
MeU7iOrysmXzxY8d6U2P758F24rPhNe5nHfgjvPQU4qSwaD6ib0QNm2AHTFF8ot6lROTGejkq1zw
H4Ve631o9r_oh_uL.qQ--
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQGJaWvPXwJqf5icjAQ/OktvdS4XLwJBtumuAlZstTgCr4ZatwIeFkQTAtV3ypUCEaxZ6wHru4+5An8MYx8CUvGXywJP3LIHAwzfw6kCKitWsAFDpYOjAmfXFDoCl2naMwGhMahwAqt8os4CW5Qc8wGvYVn3qt12eoA=
Content-Language: en-us
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <0e7601d7a4d6$6395b070$2ac11150$@verizon.net>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<dice-20210828155623@ram.dialup.fu-berlin.de> <86a6l1thz7.fsf@jevedi.com>
<4b8ed591-2f2f-6c76-4606-b431f52cf847@DancesWithMice.info>
<mailman.485.1630190573.4164.python-list@python.org>
<864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com>
 by: Avi Gross - Wed, 8 Sep 2021 17:24 UTC

Charles,

This forum is for python discussions so I will clarify that there is nothing
wrong with making up a new language, including by bootstrapping an old
language. But why not call it new and do not try to confuse people using the
old.

Python has grown and added much over the years and even had a fairly
negative experience in a transition from versions 2 to 3 as some people
complain their old software no longer works.

If you look at a language like C which was remade into C++, guess what? It
has a new name and makes no claims to be fully compatible.

If RATFOR was a more pleasant programming environment for some people and
purposes, fine.

I note Python has many modules that for some people become the most used
parts even when the base language might allow some similar functionality.
Someone who learns python but has never experienced those, may feel a bit
lost. And you can customize Python to a point where it does things in fairly
hidden ways too. There are no promises of purity.

What this particular discussion began with was much lower level and about
various ways of writing a while loop within very basic Python and seems to
be heading away into discussions of other languages. I happen to enjoy
learning and contrasting lots of languages but doubt many others do and most
people want to learn just a few good tools and use them to get their job
done. My point was if you have a tool you like and you try another you
don't, then rather than trying to force the new one, just use what works and
leave others that like it alone. Make your own religion and let others keep
theirs.

However, improvements and increased functionality may be more welcome, than
examples where the interface was changed with no benefits.

-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net@python.org> On
Behalf Of charles hottel
Sent: Tuesday, September 7, 2021 11:31 PM
To: python-list@python.org
Subject: Re: on writing a while loop for rolling two dice

<SNIP>

So what do yoy think or feel about a language like RATFOR (Rational
FORTRAN) which was implemented as macros? Should they instead have simply
adapted themselves to FORTRAN?
--
https://mail.python.org/mailman/listinfo/python-list

Re: on writing a while loop for rolling two dice

<mailman.670.1631124823.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19479&group=comp.lang.python#19479

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b.edwards@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Wed, 8 Sep 2021 16:32:45 -0000 (UTC)
Lines: 31
Message-ID: <mailman.670.1631124823.4164.python-list@python.org>
References: <864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<sh8sbs$1684$1@ciao.gmane.io> <k6mhjgh5rfk7q34ocjvfes061h109r8vpb@4ax.com>
<shaojd$sbj$1@ciao.gmane.io>
X-Trace: news.uni-berlin.de BrXS7Hck3tpp+6HuZCgT0AIvZiSj8qC9yGhcB6eEA7Jg==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.013
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'apparently': 0.09;
'ended': 0.09; 'message-id:@ciao.gmane.io': 0.09;
'received:ciao.gmane.io': 0.09; 'received:gmane.io': 0.09;
'received:list': 0.09; 'subject:two': 0.09; 'trivial': 0.09;
"can't": 0.14; 'executables': 0.16; 'fixes': 0.16;
'from:addr:grant.b.edwards': 0.16; 'from:name:grant edwards':
0.16; 'originated': 0.16; 'ported': 0.16; 'received:116.202':
0.16; 'received:116.202.254': 0.16; 'received:116.202.254.214':
0.16; 'subject:loop': 0.16; 'subject:while': 0.16;
'subject:writing': 0.16; 'wrote:': 0.16; 'grant': 0.17; 'to:addr
:python-list': 0.23; 'code': 0.24; 'maintaining': 0.27; 'output':
0.28; 'header:User-Agent:1': 0.31; 'stuff': 0.31; 'definitely':
0.31; 'using': 0.33; 'subject:for': 0.33; 'handling': 0.35;
'from:addr:gmail.com': 0.35; 'close': 0.36; 'though': 0.38;
'source': 0.38; 'build': 0.40; 'pretty': 0.40; 'well.': 0.61;
'hope': 0.61; 'paid': 0.61; 'remember': 0.61; 'lot': 0.62; 'back':
0.65; 'source.': 0.65; 'management': 0.67; 'years': 0.67; 'piece':
0.69; 'received:116': 0.71; 'compared': 0.71; 'major': 0.75;
'features': 0.76; 'career': 0.78; 'spent': 0.81; 'somebody': 0.91
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: slrn/1.0.3 (Linux)
X-Mailman-Approved-At: Wed, 08 Sep 2021 14:13:42 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <shaojd$sbj$1@ciao.gmane.io>
X-Mailman-Original-References: <864kb3m4qi.fsf@jevedi.com>
<CAPTjJmqg=n5xSs+61hG+4_k4hmzgkTd1jxfPn+TKT5S8sQix_A@mail.gmail.com>
<mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<sh8sbs$1684$1@ciao.gmane.io> <k6mhjgh5rfk7q34ocjvfes061h109r8vpb@4ax.com>
 by: Grant Edwards - Wed, 8 Sep 2021 16:32 UTC

On 2021-09-08, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:

> I spent close to 20 years (80s-90s) maintaining the /output/ of such
> a preprocessor.

Ouch. I hope it paid well. ;)

Back when I did a lot of TeX/LaTeX stuff on VMS, I used to make
occasional fixes and add (very minor) features to one of the dvi
handling executables (I don't remember if it was the VT2xx previewer,
or the laser-printer "driver") using the VMS "PATCH" utility. I also
can't remember how we ended up without source code for that piece of
the toolchain when we build all of the reset of it from source.

> The software had apparently originated with a sub-contractor, and we
> did not have access to their preprocessor

Allowing that to happen is definitely a major management F*%k-up for
which somebody should have had their career ended.

> (and/or no one ported it to the VAX-11 from PDP-11).

I would have though that would have been pretty trivial compared to
maintaining the output source for 20 years.

--
Grant

Re: on writing a while loop for rolling two dice

<mailman.671.1631124823.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19480&group=comp.lang.python#19480

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: wlfraed@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Wed, 08 Sep 2021 12:59:11 -0400
Organization: IISS Elusive Unicorn
Lines: 33
Message-ID: <mailman.671.1631124823.4164.python-list@python.org>
References: <004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com> <shaic4$b76$1@ciao.gmane.io>
<jjqhjghvk643iaisg79lui02lb332k7ung@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 6A3wibV1Qj3MfZEOKNTVbAp3hrEGJLqA8jF55yKEXE7A==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.017
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '(e.g.': 0.04; '(for':
0.05; 'received:ciao.gmane.io': 0.09; 'received:gmane.io': 0.09;
'received:list': 0.09; 'subject:two': 0.09; 'complete,': 0.16;
'loops': 0.16; 'message-id:@4ax.com': 0.16; 'received:116.202':
0.16; 'received:116.202.254': 0.16; 'received:116.202.254.214':
0.16; 'skip:> 10': 0.16; 'subject:loop': 0.16; 'subject:while':
0.16; 'subject:writing': 0.16; 'wrote:': 0.16; 'grant': 0.17;
'instead': 0.17; 'language': 0.22; 'doubt': 0.23; 'ran': 0.23;
'to:addr:python-list': 0.23; 'tried': 0.26; 'header:User-Agent:1':
0.31; 'header:Organization:1': 0.31; 'think': 0.31; 'question.':
0.31; 'cpu': 0.32; 'sep': 0.32; 'using': 0.33; 'class': 0.33;
'subject:for': 0.33; 'image': 0.37; 'two': 0.37; 'really': 0.37;
"it's": 0.38; 'source': 0.38; 'reason': 0.40; 'enough': 0.40;
'skip:w 10': 0.61; 'feel': 0.61; 'simply': 0.62; 'share': 0.63;
'providing': 0.64; 'per': 0.64; 'times': 0.66; 'implemented':
0.69; 'translated': 0.69; 'received:116': 0.71; 'interesting':
0.71; '2021': 0.84; 'experiment': 0.84; 'url-ip:76/8': 0.84;
'term.': 0.91
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: ForteAgent/8.00.32.1272
X-Mailman-Approved-At: Wed, 08 Sep 2021 14:13:42 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <jjqhjghvk643iaisg79lui02lb332k7ung@4ax.com>
X-Mailman-Original-References: <004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
<018401d7a44f$accc70d0$06655270$@verizon.net>
<mailman.662.1631064022.4164.python-list@python.org>
<StidnQG7qqQSs6X8nZ2dnUU7-TnNnZ2d@earthlink.com> <shaic4$b76$1@ciao.gmane.io>
 by: Dennis Lee Bieber - Wed, 8 Sep 2021 16:59 UTC

On Wed, 8 Sep 2021 14:46:28 -0000 (UTC), Grant Edwards
<grant.b.edwards@gmail.com> declaimed the following:

>On 2021-09-08, charles hottel <chottel@earthlink.net> wrote:
>
>> So what do yoy think or feel about a language like RATFOR (Rational
>> FORTRAN) which was implemented as macros? Should they instead have
>> simply adapted themselves to FORTRAN?
>
>That's an interesting question. If the langauge is complete,
>well-defined, and well-documented then it's not that much different
>than any other source language than gets translated into a lower level
>language (e.g. C -> assembly). My recollection of RATFOR was that it
>provided enough signifcant "features" that weren't available in the
>underlying FORTRAN to make it worthwhile.
>

Primarily providing block structured IF/ELSE and loops -- in a language
that only really provided IF/GOTO...

My college tried using one of these (for some reason the name TextFOR
sticks with me)... The experiment only lasted one term. The preprocessor
ate CPU and I/O time -- with the result that the FORTRAN class used two or
three times the times of the COBOL class! (The native compilers were
designed as re-entrant, allowing multiple compiles to share one in-core
image; the preprocessor no doubt ran as one image per compile, triggering
lots of page swapping to disk)

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: on writing a while loop for rolling two dice

<mailman.672.1631133049.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19481&group=comp.lang.python#19481

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: wlfraed@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Wed, 08 Sep 2021 15:54:58 -0400
Organization: IISS Elusive Unicorn
Lines: 52
Message-ID: <mailman.672.1631133049.4164.python-list@python.org>
References: <mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<sh8sbs$1684$1@ciao.gmane.io> <k6mhjgh5rfk7q34ocjvfes061h109r8vpb@4ax.com>
<shaojd$sbj$1@ciao.gmane.io>
<1b4ijglpmc9ladcijv8jv71ui4p61oiqvk@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de yguFqUiefIsaQzH9HRjmOwe350ElFO/NgiEgfXlznGDA==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.086
X-Spam-Evidence: '*H*': 0.83; '*S*': 0.00; 'graphics': 0.07;
'apparently': 0.09; 'deeper': 0.09; 'porting': 0.09;
'received:ciao.gmane.io': 0.09; 'received:gmane.io': 0.09;
'received:list': 0.09; 'subject:two': 0.09; 'trivial': 0.09;
"can't": 0.14; '(may': 0.16; 'isolated': 0.16; 'message-
id:@4ax.com': 0.16; 'originated': 0.16; 'plotting': 0.16;
'ported': 0.16; 'received:116.202': 0.16; 'received:116.202.254':
0.16; 'received:116.202.254.214': 0.16; 'rewrite': 0.16;
'subject:loop': 0.16; 'subject:while': 0.16; 'subject:writing':
0.16; 'wrote:': 0.16; 'grant': 0.17; 'generated': 0.20;
'installed': 0.20; 'to:addr:python-list': 0.23; 'files,': 0.27;
'library': 0.27; 'maintaining': 0.27; 'output': 0.28; 'header
:User-Agent:1': 0.31; 'header:Organization:1': 0.31; 'it,': 0.31;
'think': 0.31; 'but': 0.31; 'dec': 0.31; 'definitely': 0.31;
'program,': 0.31; "i'm": 0.32; 'half': 0.32; 'sep': 0.32;
'program': 0.33; 'subject:for': 0.33; 'running': 0.35; 'close':
0.36; 'display': 0.37; 'changes': 0.37; 'file': 0.38; 'though':
0.38; 'source': 0.38; 'someone': 0.39; 'could': 0.40; 'pretty':
0.40; 'send': 0.61; 'well.': 0.61; 'hope': 0.61; 'paid': 0.61;
'ever': 0.63; 'security': 0.64; 'per': 0.64; 'cost': 0.64; 'back':
0.65; 'unit': 0.65; 'parts': 0.66; 'times': 0.66; 'during': 0.67;
'suite': 0.67; 'management': 0.67; 'years': 0.67; 'service': 0.68;
'facility': 0.69; 'owned': 0.69; 'received:116': 0.71; 'compared':
0.71; 'maintenance': 0.71; 'known': 0.75; 'major': 0.75; 'career':
0.78; 'led': 0.81; 'spent': 0.81; '2021': 0.84; '(first': 0.84;
'drove': 0.84; 'eventually': 0.84; 'side.': 0.84; 'url-ip:76/8':
0.84; 'somebody': 0.91
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: ForteAgent/8.00.32.1272
X-Mailman-Approved-At: Wed, 08 Sep 2021 16:30:48 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <1b4ijglpmc9ladcijv8jv71ui4p61oiqvk@4ax.com>
X-Mailman-Original-References: <mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de> <sh7ud8$4cr$1@ciao.gmane.io>
<sh8sbs$1684$1@ciao.gmane.io> <k6mhjgh5rfk7q34ocjvfes061h109r8vpb@4ax.com>
<shaojd$sbj$1@ciao.gmane.io>
 by: Dennis Lee Bieber - Wed, 8 Sep 2021 19:54 UTC

On Wed, 8 Sep 2021 16:32:45 -0000 (UTC), Grant Edwards
<grant.b.edwards@gmail.com> declaimed the following:

>On 2021-09-08, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>
>> I spent close to 20 years (80s-90s) maintaining the /output/ of such
>> a preprocessor.
>
>Ouch. I hope it paid well. ;)

Only if one ignores the bloody cost of apartments (given the rent paid
over the 30 years I spent in that 1BR 680sq.ft. unit I should have owned
it, if not half the facility <G>)
>
>> The software had apparently originated with a sub-contractor, and we
>> did not have access to their preprocessor
>
>Allowing that to happen is definitely a major management F*%k-up for
>which somebody should have had their career ended.
>
For all I know, someone might have... Back when the application was
running on PDP-11 (I joined the program early 80s, when the "mission
planning" software was being ported to the VAX-11).

Most of the "mission planning" software was local-grown, so was DEC
FORTRAN (may have started as F-IV, and developed F77 during maintenance and
the porting to the VAX). Not the part I maintained -- which drove a Ramtek
9300 graphics engine (only one engine could be installed into a VAX, it was
that archaic). It got to the point where I think Ramtek service was
recycling the parts when ever we had a service call. Eventually I proposed
that a VAXstation (DECWindows) and GKS could replace most of the display
side. We weren't approved to rewrite the application to directly display --
but rewriting the Ramtek library to send the plotting data to a separate
program, which managed the display window, was in the budget.

>
>I would have though that would have been pretty trivial compared to
>maintaining the output source for 20 years.

I'm not so sure -- that "one file per executable" would have led to
long compile times (first for the preprocessor, then for the generated F-IV
output), vs my rewrites into multiple files, where only isolated changes
needed to be recompiled.

Humorously, the graphics application suite was known as "MESS" (I can't
go deeper into the acronym without violating security classification).

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: on writing a while loop for rolling two dice

<mailman.693.1631337901.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19519&group=comp.lang.python#19519

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonList@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Sat, 11 Sep 2021 17:24:47 +1200
Organization: DWM
Lines: 62
Message-ID: <mailman.693.1631337901.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
<b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 11Pb/tNQqSTWYYUYDo3ldwpYBmPom4mm3lQkd4xZSecA==
Return-Path: <PythonList@DancesWithMice.info>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=danceswithmice.info header.i=@danceswithmice.info
header.b=LYT0yIw3; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'def': 0.04; 'random':
0.05; 'aug': 0.07; '(assuming': 0.09; '=dn': 0.09; 'angelico':
0.09; 'from:addr:danceswithmice.info': 0.09;
'from:addr:pythonlist': 0.09; 'readable': 0.09; 'subject:two':
0.09; 'subject:writing': 0.09; 'coding': 0.13; 'import': 0.15;
'fame': 0.16; 'itertools': 0.16; 'lambda': 0.16; 'message-
id:@DancesWithMice.info': 0.16; 'received:51.254': 0.16;
'received:51.254.211': 0.16; 'received:51.254.211.219': 0.16;
'received:cloud': 0.16; 'received:rangi.cloud': 0.16;
'subject:loop': 0.16; 'subject:while': 0.16; 'yield': 0.16;
'wrote:': 0.16; 'uses': 0.19; 'to:addr:python-list': 0.20;
'option': 0.20; 'returns': 0.22; 'version': 0.23; 'creating':
0.27; '>>>': 0.28; 'chris': 0.28; 'header:User-Agent:1': 0.30;
'header:Organization:1': 0.31; "doesn't": 0.32; 'answers': 0.32;
'received:192.168.1': 0.32; 'but': 0.32; 'subject:for': 0.33;
"didn't": 0.34; 'header:In-Reply-To:1': 0.34; 'rates': 0.35;
"we're": 0.35; 'also,': 0.36; 'mon,': 0.36; 'member': 0.37;
'using': 0.37; 'received:192.168': 0.37; 'way': 0.38; 'two': 0.39;
'single': 0.39; 'use': 0.39; 'still': 0.40; 'skip:h 10': 0.61;
'seen': 0.62; 'skip:i 20': 0.62; 'our': 0.64; 'received:51': 0.64;
'received:userid': 0.66; 'url:8': 0.67; 'skip:e 20': 0.67;
'within': 0.69; 'solutions': 0.70; '2021': 0.71; 'claim': 0.71;
'features': 0.75; 'leads': 0.81; 'points': 0.84; 'retains': 0.84;
'rolls': 0.84; 'true:': 0.84
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vps517507.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-3.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A autolearn=ham
autolearn_force=no version=3.4.0
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.rangi.cloud 22F953B5D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1631337898;
bh=G2UPpnMAyHgyS1cbtFkFb8uU55k1VKzui5IOO9WIfVc=;
h=Subject:To:References:From:Date:In-Reply-To:From;
b=LYT0yIw3dDKON1XJwSTuqZyj81aHbn2uZAHhHYnxedD0EIjlriqD38aCP6vHh3AMp
KyNLAiDqoMLLqNXnconB6DMsisT+BREgJpp4P0RF06hQtB+0ZLgu/8o6U3m8DJDMdJ
LQP9SheMd8IIGPBbDrDeZcJn5+wLnIPikakbbc5yxEhIsXwDzhxHpU70xVI/pcDfRZ
DfH8dmfhenBl1/jbZZM0j3rYbN2QbZbnRXHihS0seiIKS7EriZZ3eoQjbcFc9y0YjN
t5Qk2TdNbuxaY6R2XOXNdOgBztz4IodV9hrtcJrFsV2X6fvWD5wNszqezSG42qsHo5
HM8D5mjW1BNrQ==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
In-Reply-To: <CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
Content-Language: en-GB
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
 by: dn - Sat, 11 Sep 2021 05:24 UTC

On 31/08/2021 01.50, Chris Angelico wrote:
> On Mon, Aug 30, 2021 at 11:13 PM David Raymond <David.Raymond@tomtom.com> wrote:
>>
>>> def how_many_times():
>>> x, y = 0, 1
>>> c = 0
>>> while x != y:
>>> c = c + 1
>>> x, y = roll()
>>> return c, (x, y)
>>
>> Since I haven't seen it used in answers yet, here's another option using our new walrus operator
>>
>> def how_many_times():
>> roll_count = 1
>> while (rolls := roll())[0] != rolls[1]:
>> roll_count += 1
>> return (roll_count, rolls)
>>
>
> Since we're creating solutions that use features in completely
> unnecessary ways, here's a version that uses collections.Counter:
>
> def how_many_times():
> return next((count, rolls) for count, rolls in
> enumerate(iter(roll, None)) if len(Counter(rolls)) == 1)
>
> Do I get bonus points for it being a one-liner that doesn't fit in
> eighty characters?

Herewith my claim to one-liner fame (assuming such leads in any way to
virtue or fame)

It retains @Peter's preference for a more re-usable roll_die() which
returns a single event, cf the OP's roll() which returns two results).

import itertools, random

def roll_die():
while True:
yield random.randrange(1, 7)

def how_many_times():
return list( itertools.takewhile( lambda r:r[ 0 ] != r[ 1 ],
zip( roll_die(), roll_die() )
)
)

Also, a claim for 'bonus points' because the one-liner will fit within
80-characters - if only I didn't have that pernicious and vile habit of
coding a more readable layout.

It doesn't use a two-arg iter, but still rates because it does use a
relatively-obscure member of the itertools library...

https://docs.python.org/3.8/library/itertools.html#itertools.takewhile
--
Regards,
=dn

Re: on writing a while loop for rolling two dice

<mailman.694.1631340219.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19520&group=comp.lang.python#19520

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Sat, 11 Sep 2021 16:03:26 +1000
Lines: 70
Message-ID: <mailman.694.1631340219.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
<b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
<CAPTjJmrzvq2J31Jo0cFgPcgG8rZr7Vsb5Qt20aT+NvwRJfzsEQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 5awwAMz9RGBAIMH0vwvePgIJ811hos30KgcUqg7YUvjQ==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=jNEutzZr;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.007
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'def': 0.04; 'random':
0.05; 'aug': 0.07; 'matching': 0.07; '(assuming': 0.09;
'angelico': 0.09; 'readable': 0.09; 'subject:two': 0.09;
'subject:writing': 0.09; 'coding': 0.13; 'import': 0.15; 'chrisa':
0.16; 'epic': 0.16; 'fame': 0.16; 'from:addr:rosuav': 0.16;
'from:name:chris angelico': 0.16; 'itertools': 0.16; 'lambda':
0.16; 'received:209.85.166.42': 0.16; 'received:mail-
io1-f42.google.com': 0.16; 'subject:loop': 0.16; 'subject:while':
0.16; 'yield': 0.16; 'wrote:': 0.16; 'uses': 0.19; 'to:addr
:python-list': 0.20; 'option': 0.20; 'language': 0.21; 'returns':
0.22; 'sat,': 0.22; 'version': 0.23; '11,': 0.26; 'creating':
0.27; '>>>': 0.28; 'chris': 0.28; "doesn't": 0.32; 'answers':
0.32; 'python-list': 0.32; 'sep': 0.32; 'to:name:python': 0.32;
'message-id:@mail.gmail.com': 0.32; 'but': 0.32; 'subject:for':
0.33; "didn't": 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'rates': 0.35; 'received:209.85.166':
0.35; 'from:addr:gmail.com': 0.35; "we're": 0.35; 'also,': 0.36;
'count': 0.36; 'mon,': 0.36; 'member': 0.37; 'using': 0.37;
'received:209.85': 0.37; 'way': 0.38; 'received:209': 0.39; 'two':
0.39; 'single': 0.39; 'use': 0.39; 'still': 0.40; 'skip:h 10':
0.61; 'seen': 0.62; 'skip:i 20': 0.62; 'our': 0.64; 'opportunity':
0.66; 'skip:e 20': 0.67; 'within': 0.69; 'solutions': 0.70;
'2021': 0.71; 'claim': 0.71; 'features': 0.75; 'leads': 0.81;
'points': 0.84; 'capture': 0.84; 'match.': 0.84; 'retains': 0.84;
'rolls': 0.84; 'those,': 0.84; 'true:': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=GGY27yI3j8ueqG1iXVakMLanrSmQonWaTncBXsgDqyk=;
b=jNEutzZrF6qnsnvMbjx7R+Y65tLySCUIPZl5lXwBRmQhXhHYkIkDjBFC5RDzri/KGU
3cixzM3bm43HpE26N7/70C7rsCra+Ys7rDDSdODLpM/o8xPEOP0HajlFBEFQLXuN6rOX
zaReNAABn13oRNKXAY7BUQc+naI0v0ZIRnJVTS4tUVLMFNVUXKcXZ/Z+89vrM+nNPZHo
NGptQWV4zJynv1+Kp8qCic33MQybci3vGb1j9gDeKO2QxdnWM9qX7BTjSfC6+AsMy1Ok
8g+ss9sNQySocrrZ2Z7T/IWEiPFTxFX0Fg8EvO7/fKe04R5sNXOK0ba1l/DDRv4c3o38
PTuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=GGY27yI3j8ueqG1iXVakMLanrSmQonWaTncBXsgDqyk=;
b=eorsndOb/x4uJSgD+HF4X6rcQj/huClMGpfvYKqal9gZhgxlsYYM6UbRuXH5NiPp4I
93daqFPiManwRkyiKGPiTmFjdWroEcLKn4lMALGFR9TJCMaQ0LlvY4cBMeC8s48Yw8tu
xnVUUqLlwhCCV7MKcLeeMCJYe3U3+9jpEYZ2E6IxhbShdEWoyC7q8ClRdhWWyikpqVxg
nCkl68jSSQncB/foMORzLoGXWw8bOuITxQXE1COYrJxLzNATI/10R/IbXWLnUUFL2Evw
hjOJ2KNpigmLTqEQXWytxxssP3VQHPJ9mzaN9T9JLSYO/7qQaJPmVwS3/QxpHJbdv651
uiaA==
X-Gm-Message-State: AOAM531/OILni+kQP1P1Bkt6LEB/p45fXrcAPhTKw4ELk5i6xlHN3ss0
d/1amTsyuJ3knIGBMI435UcHCtNEg4O2/TXsKomVPO8ngL0=
X-Google-Smtp-Source: ABdhPJwGa0/j007N+q19bb0qO7Lqhm545WOjncvfxSxKBy14GwQw9PQDkbS4obqjPfA6UUZ2XuhQw8xS5HzDZR9rqx0=
X-Received: by 2002:a05:6638:348e:: with SMTP id
t14mr1154663jal.66.1631340217812;
Fri, 10 Sep 2021 23:03:37 -0700 (PDT)
In-Reply-To: <b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmrzvq2J31Jo0cFgPcgG8rZr7Vsb5Qt20aT+NvwRJfzsEQ@mail.gmail.com>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
<b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
 by: Chris Angelico - Sat, 11 Sep 2021 06:03 UTC

On Sat, Sep 11, 2021 at 3:26 PM dn via Python-list
<python-list@python.org> wrote:
>
> On 31/08/2021 01.50, Chris Angelico wrote:
> > On Mon, Aug 30, 2021 at 11:13 PM David Raymond <David.Raymond@tomtom.com> wrote:
> >>
> >>> def how_many_times():
> >>> x, y = 0, 1
> >>> c = 0
> >>> while x != y:
> >>> c = c + 1
> >>> x, y = roll()
> >>> return c, (x, y)
> >>
> >> Since I haven't seen it used in answers yet, here's another option using our new walrus operator
> >>
> >> def how_many_times():
> >> roll_count = 1
> >> while (rolls := roll())[0] != rolls[1]:
> >> roll_count += 1
> >> return (roll_count, rolls)
> >>
> >
> > Since we're creating solutions that use features in completely
> > unnecessary ways, here's a version that uses collections.Counter:
> >
> > def how_many_times():
> > return next((count, rolls) for count, rolls in
> > enumerate(iter(roll, None)) if len(Counter(rolls)) == 1)
> >
> > Do I get bonus points for it being a one-liner that doesn't fit in
> > eighty characters?
>
>
> Herewith my claim to one-liner fame (assuming such leads in any way to
> virtue or fame)
>
> It retains @Peter's preference for a more re-usable roll_die() which
> returns a single event, cf the OP's roll() which returns two results).
>
>
> import itertools, random
>
> def roll_die():
> while True:
> yield random.randrange(1, 7)
>
> def how_many_times():
> return list( itertools.takewhile( lambda r:r[ 0 ] != r[ 1 ],
> zip( roll_die(), roll_die() )
> )
> )
>
> Also, a claim for 'bonus points' because the one-liner will fit within
> 80-characters - if only I didn't have that pernicious and vile habit of
> coding a more readable layout.
>
> It doesn't use a two-arg iter, but still rates because it does use a
> relatively-obscure member of the itertools library...
>

Nice, but that's only going to give you the ones that don't match. You
can then count those, and that's a start, but how do you capture the
matching rolls?

I smell another opportunity for gratuitous use of a language feature:
nonlocal. In a lambda function. Which may require shenanigans of epic
proportions.

ChrisA

Re: on writing a while loop for rolling two dice

<mailman.696.1631351392.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19523&group=comp.lang.python#19523

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonList@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Sat, 11 Sep 2021 21:09:38 +1200
Organization: DWM
Lines: 85
Message-ID: <mailman.696.1631351392.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
<b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
<CAPTjJmrzvq2J31Jo0cFgPcgG8rZr7Vsb5Qt20aT+NvwRJfzsEQ@mail.gmail.com>
<854aa6b9-558f-b280-4d7e-e9ed1d0a9aeb@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de L0yk0GPPg6m2u4xWrXXK5gQ+4q7ybb5n+fwcBEcwraZQ==
Return-Path: <PythonList@DancesWithMice.info>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=danceswithmice.info header.i=@danceswithmice.info
header.b=aYBhYJ2s; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.008
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'def': 0.04; 'random':
0.05; 'aug': 0.07; 'matching': 0.07; '(assuming': 0.09; '=dn':
0.09; 'angelico': 0.09; 'from:addr:danceswithmice.info': 0.09;
'from:addr:pythonlist': 0.09; 'readable': 0.09; 'solution,': 0.09;
'subject:two': 0.09; 'subject:writing': 0.09; 'coding': 0.13;
'import': 0.15; '>>>>': 0.16; '>>>>>': 0.16; 'epic': 0.16; 'fame':
0.16; 'itertools': 0.16; 'lambda': 0.16; 'message-
id:@DancesWithMice.info': 0.16; 'received:51.254': 0.16;
'received:51.254.211': 0.16; 'received:51.254.211.219': 0.16;
'received:cloud': 0.16; 'received:rangi.cloud': 0.16;
'subject:loop': 0.16; 'subject:while': 0.16; 'values?': 0.16;
'yield': 0.16; 'wrote:': 0.16; 'uses': 0.19; 'to:addr:python-
list': 0.20; 'option': 0.20; 'language': 0.21; 'returns': 0.22;
'sat,': 0.22; 'version': 0.23; '11,': 0.26; 'creating': 0.27;
'>>>': 0.28; 'chris': 0.28; 'header:User-Agent:1': 0.30;
'header:Organization:1': 0.31; "doesn't": 0.32; 'answers': 0.32;
'python-list': 0.32; 'returning': 0.32; 'sep': 0.32;
'received:192.168.1': 0.32; 'but': 0.32; "i'll": 0.33;
'subject:for': 0.33; "didn't": 0.34; 'header:In-Reply-To:1': 0.34;
'rates': 0.35; "we're": 0.35; 'also,': 0.36; 'count': 0.36;
'mon,': 0.36; 'member': 0.37; 'using': 0.37; 'received:192.168':
0.37; 'way': 0.38; 'means': 0.38; 'two': 0.39; 'single': 0.39;
'list': 0.39; 'use': 0.39; 'still': 0.40; 'stated': 0.60; 'skip:h
10': 0.61; 'seen': 0.62; 'skip:i 20': 0.62; 'our': 0.64;
'received:51': 0.64; 'requirement': 0.64; 'look': 0.65;
'opportunity': 0.66; 'received:userid': 0.66; 'skip:e 20': 0.67;
'settle': 0.69; 'times': 0.69; 'within': 0.69; 'solutions': 0.70;
'2021': 0.71; 'claim': 0.71; 'features': 0.75; 'leads': 0.81;
'points': 0.84; '"i\'d': 0.84; 'capture': 0.84; 'further,': 0.84;
'match.': 0.84; 'pairs': 0.84; 'regret': 0.84; 'retains': 0.84;
'rolls': 0.84; 'those,': 0.84; 'true:': 0.84
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vps517507.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-3.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A autolearn=ham
autolearn_force=no version=3.4.0
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.rangi.cloud 3FFF93B89
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1631351388;
bh=7XWAkq0CEetPSfd8BuO8bXeHSdstMHhvfoknbiWlMkg=;
h=Subject:To:References:From:Date:In-Reply-To:From;
b=aYBhYJ2sdki7d4SGXa2eRc3Ht3LPyleGqbpkHDReZFeECyOlIoSozqTsH3A1WOJxv
+v142dX5o1fge2pKY9AmWWhPz1SiauixBvONbk9vxNDsSw1WubSGfUrScCw3QsVKTY
80dKUETh/qXTcee4E3BmQqlsBDYpbTeBTj9hAf087llCHmPNeHNEpkEvpKItqxQ4E3
kEYK6I+c9TqnIFx+4WvRBwuKwBhvJYHRz9oh04uWQc9FB9QY8bPl+56TaSwVzqDZXp
Jo/5fs15N3MKR3wOHGlVUy6JD+r0vbMVV07Yo5PNiMcB19PtlRJ9LHTn2Wo9hYssCP
mJZgsJf/QevHA==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
In-Reply-To: <CAPTjJmrzvq2J31Jo0cFgPcgG8rZr7Vsb5Qt20aT+NvwRJfzsEQ@mail.gmail.com>
Content-Language: en-GB
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <854aa6b9-558f-b280-4d7e-e9ed1d0a9aeb@DancesWithMice.info>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
<b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
<CAPTjJmrzvq2J31Jo0cFgPcgG8rZr7Vsb5Qt20aT+NvwRJfzsEQ@mail.gmail.com>
 by: dn - Sat, 11 Sep 2021 09:09 UTC

On 11/09/2021 18.03, Chris Angelico wrote:
> On Sat, Sep 11, 2021 at 3:26 PM dn via Python-list
> <python-list@python.org> wrote:
>>
>> On 31/08/2021 01.50, Chris Angelico wrote:
>>> On Mon, Aug 30, 2021 at 11:13 PM David Raymond <David.Raymond@tomtom.com> wrote:
>>>>
>>>>> def how_many_times():
>>>>> x, y = 0, 1
>>>>> c = 0
>>>>> while x != y:
>>>>> c = c + 1
>>>>> x, y = roll()
>>>>> return c, (x, y)
>>>>
>>>> Since I haven't seen it used in answers yet, here's another option using our new walrus operator
>>>>
>>>> def how_many_times():
>>>> roll_count = 1
>>>> while (rolls := roll())[0] != rolls[1]:
>>>> roll_count += 1
>>>> return (roll_count, rolls)
>>>>
>>>
>>> Since we're creating solutions that use features in completely
>>> unnecessary ways, here's a version that uses collections.Counter:
>>>
>>> def how_many_times():
>>> return next((count, rolls) for count, rolls in
>>> enumerate(iter(roll, None)) if len(Counter(rolls)) == 1)
>>>
>>> Do I get bonus points for it being a one-liner that doesn't fit in
>>> eighty characters?
>>
>>
>> Herewith my claim to one-liner fame (assuming such leads in any way to
>> virtue or fame)
>>
>> It retains @Peter's preference for a more re-usable roll_die() which
>> returns a single event, cf the OP's roll() which returns two results).
>>
>>
>> import itertools, random
>>
>> def roll_die():
>> while True:
>> yield random.randrange(1, 7)
>>
>> def how_many_times():
>> return list( itertools.takewhile( lambda r:r[ 0 ] != r[ 1 ],
>> zip( roll_die(), roll_die() )
>> )
>> )
>>
>> Also, a claim for 'bonus points' because the one-liner will fit within
>> 80-characters - if only I didn't have that pernicious and vile habit of
>> coding a more readable layout.
>>
>> It doesn't use a two-arg iter, but still rates because it does use a
>> relatively-obscure member of the itertools library...
>>
>
> Nice, but that's only going to give you the ones that don't match. You
> can then count those, and that's a start, but how do you capture the
> matching rolls?
>
> I smell another opportunity for gratuitous use of a language feature:
> nonlocal. In a lambda function. Which may require shenanigans of epic
> proportions.

The stated requirement is: "I'd like to get the number of times I
tried". Given such: why bother with returning any of the pairs of values?

Further, if you look at the OP's original solution, it only publishes
the last pair, ie the match, without mention of the list of non-matches.
Was it perhaps only a means of testing the solution?

Regret that I'll settle for (or continue to seek) 'fame'. I don't play
guitar, so have no use for epic.
--
Regards,
=dn

Re: on writing a while loop for rolling two dice

<mailman.697.1631364010.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19524&group=comp.lang.python#19524

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-python@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Sat, 11 Sep 2021 14:40:00 +0200
Lines: 47
Message-ID: <mailman.697.1631364010.4164.python-list@python.org>
References: <mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com> <sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de>
<sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net> <YTyjoJuZK4AEbylR@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="mdnO0onA2TRpgSFi"
X-Trace: news.uni-berlin.de P+J//TIu1+bp2Qw3tmKenQf6BhrnN2LKMJkIe/Aswlhw==
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'content-
type:multipart/signed': 0.05; 'content-type:application/pgp-
signature': 0.09; 'filename:fname piece:asc': 0.09;
'filename:fname piece:signature': 0.09;
'filename:fname:signature.asc': 0.09; 'resemble': 0.09;
'subject:two': 0.09; 'subject:writing': 0.09; '"creative': 0.16;
'__/': 0.16; 'challenge!"': 0.16; 'endif': 0.16; 'from:addr:hjp-
python': 0.16; 'from:addr:hjp.at': 0.16; 'from:name:peter j.
holzer': 0.16; 'greg': 0.16; 'hjp@hjp.at': 0.16; 'holzer': 0.16;
'reality.': 0.16; 'stross,': 0.16; 'subject:loop': 0.16;
'subject:while': 0.16; 'url-ip:212.17.106.137/32': 0.16; 'url-
ip:212.17.106/24': 0.16; 'url-ip:212.17/16': 0.16; 'url:hjp':
0.16; 'utilities': 0.16; '|_|_)': 0.16; 'wrote:': 0.16; 'grant':
0.17; 'to:addr:python-list': 0.20; 'written': 0.22; 'else': 0.27;
'sense': 0.28; 'am,': 0.31; 'subject:for': 0.33; 'someone': 0.34;
'header:In-Reply-To:1': 0.34; 'using': 0.37; 'author': 0.37;
'steve': 0.39; 'received:212': 0.62; 'received:userid': 0.66;
'url-ip:212/8': 0.69; 'macros': 0.84; 'received:at': 0.84
Content-Disposition: inline
In-Reply-To: <ipqgn3FqmbtU1@mid.individual.net>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <YTyjoJuZK4AEbylR@hjp.at>
X-Mailman-Original-References: <mailman.574.1630609129.4164.python-list@python.org>
<8635qkh2ga.fsf@jevedi.com>
<sh0ab2$cfc$1@dont-email.me>
<b9s9jg5d53o4lqik91qcltep5j20933moo@4ax.com>
<004401d7a378$44d43580$ce7ca080$@verizon.net>
<mailman.650.1630971504.4164.python-list@python.org>
<loops-20210907004539@ram.dialup.fu-berlin.de>
<sh7ud8$4cr$1@ciao.gmane.io>
<mailman.657.1631033041.4164.python-list@python.org>
<ipqgn3FqmbtU1@mid.individual.net>
 by: Peter J. Holzer - Sat, 11 Sep 2021 12:40 UTC
Attachments: signature.asc (application/pgp-signature)

On 2021-09-08 13:07:47 +1200, Greg Ewing wrote:
> On 8/09/21 2:53 am, Grant Edwards wrote:
> > #define IF if (
> > #define THEN ) {
> > #define ELSE } else {
> > #define ENDIF }
>
> I gather that early versions of some of the Unix utilities were
> written by someone who liked using macros to make C resemble Algol.

Steve Bourne, the author of the eponymous shell.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

Attachments: signature.asc (application/pgp-signature)
Re: on writing a while loop for rolling two dice

<mailman.703.1631375618.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19530&group=comp.lang.python#19530

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: a.h.jaffe@gmail.com (Andrew Jaffe)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Sat, 11 Sep 2021 11:12:20 +0100
Lines: 17
Message-ID: <mailman.703.1631375618.4164.python-list@python.org>
References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
<b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
<CAPTjJmrzvq2J31Jo0cFgPcgG8rZr7Vsb5Qt20aT+NvwRJfzsEQ@mail.gmail.com>
<854aa6b9-558f-b280-4d7e-e9ed1d0a9aeb@DancesWithMice.info>
<shhve5$jdp$1@ciao.gmane.io>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de P+J2RekqQD/IQHHmBU6twgKI9yvnTyfIcbWVgwPaHAWw==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.005
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'matches': 0.07; 'better,':
0.09; 'message-id:@ciao.gmane.io': 0.09; 'received:ciao.gmane.io':
0.09; 'received:gmane.io': 0.09; 'received:list': 0.09;
'subject:two': 0.09; 'subject:writing': 0.09; '1/6': 0.16;
'matched': 0.16; 'noting': 0.16; 'received:116.202': 0.16;
'received:116.202.254': 0.16; 'received:116.202.254.214': 0.16;
'somewhat': 0.16; 'subject:loop': 0.16; 'subject:while': 0.16;
'values?': 0.16; 'wrote:': 0.16; 'problem': 0.16; 'probably':
0.17; 'to:addr:python-list': 0.20; '(and': 0.25; 'header:User-
Agent:1': 0.30; 'from,': 0.32; 'python-list': 0.32; 'returning':
0.32; 'but': 0.32; 'subject:for': 0.33; 'particular': 0.33;
'same': 0.34; 'header:In-Reply-To:1': 0.34; 'from:addr:gmail.com':
0.35; 'could': 0.38; 'single': 0.39; 'match': 0.40; 'stated':
0.60; 'sample': 0.61; 'probability': 0.64; 'received:116': 0.64;
'requirement': 0.64; 'exactly': 0.68; 'times': 0.69; '(e.g.,':
0.76; 'die': 0.76; '"i\'d': 0.84; 'pairs': 0.84
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.1.0
In-Reply-To: <854aa6b9-558f-b280-4d7e-e9ed1d0a9aeb@DancesWithMice.info>
X-Mailman-Approved-At: Sat, 11 Sep 2021 11:53:37 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <shhve5$jdp$1@ciao.gmane.io>
X-Mailman-Original-References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
<b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
<CAPTjJmrzvq2J31Jo0cFgPcgG8rZr7Vsb5Qt20aT+NvwRJfzsEQ@mail.gmail.com>
<854aa6b9-558f-b280-4d7e-e9ed1d0a9aeb@DancesWithMice.info>
 by: Andrew Jaffe - Sat, 11 Sep 2021 10:12 UTC

On 11/09/2021 10:09, dn via Python-list wrote:
>
>
>
> The stated requirement is: "I'd like to get the number of times I
> tried". Given such: why bother with returning any of the pairs of values?

Indeed, if that's the requirement, then you can do even better, noting
that the probability of getting a matched pair is 1/6 (6 matches out of
6*6 possibilities). So the answer to the problem is exactly the same as
rolling a single die until you get any particular number (e.g., 1).

This is somewhat easier to simulate than the two-dice problem (and the
number of throws until a match is also a known, analytic distribution
that you could sample from, but this is probably easier).

Re: on writing a while loop for rolling two dice

<86ilywbmzd.fsf@jevedi.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19639&group=comp.lang.python#19639

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!nRNfeWmI5JL4mUVs0E8+uw.user.46.165.242.75.POSTED!not-for-mail
From: hrouselle@jevedi.com (Hope Rouselle)
Newsgroups: comp.lang.python
Subject: Re: on writing a while loop for rolling two dice
Date: Sun, 19 Sep 2021 12:31:50 -0300
Organization: Aioe.org NNTP Server
Message-ID: <86ilywbmzd.fsf@jevedi.com>
References: <86r1edlqxw.fsf@jevedi.com>
<AM0PR07MB5700B075D74E8E85483C0BE587CB9@AM0PR07MB5700.eurprd07.prod.outlook.com>
<CAPTjJmousW_wqKQeYKK_xa6-3Qwo5S5NN+SoFtLOfyGe0iftGQ@mail.gmail.com>
<b7c46a30-9802-9cc5-be98-d601dd45c87f@DancesWithMice.info>
<CAPTjJmrzvq2J31Jo0cFgPcgG8rZr7Vsb5Qt20aT+NvwRJfzsEQ@mail.gmail.com>
<854aa6b9-558f-b280-4d7e-e9ed1d0a9aeb@DancesWithMice.info>
<mailman.696.1631351392.4164.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="36026"; posting-host="nRNfeWmI5JL4mUVs0E8+uw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:s0Hj0SprO5HuRv//JeFMoaTQzW0=
 by: Hope Rouselle - Sun, 19 Sep 2021 15:31 UTC

dn <PythonList@DancesWithMice.info> writes:

[...]

> Further, if you look at the OP's original solution, it only publishes
> the last pair, ie the match, without mention of the list of non-matches.
> Was it perhaps only a means of testing the solution?

It was a means of showing the student that indeed they obtained a match.
If the exercise asked for returning a single die or no die at all, they
would make mistakes and there'd be no sign of them being wrong. For
instance, one trouble a lot of them went through was to start counting
from zero and so their number of rolls was off by one. (I didn't see
that coming!) The reason they fall for this is that they also test
little --- for some it never occurred a match on the first roll, so they
never saw the zero counter coming out.


devel / comp.lang.python / Re: on writing a while loop for rolling two dice

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor