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


Groups > comp.lang.python > #69637

Re: Yet Another Switch-Case Syntax Proposal

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.056
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'mrab': 0.05; 'currently,': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; '~ethan~': 0.09; '"keep': 0.16; 'hmmmm....': 0.16; 'received:69.93': 0.16; 'subject:Case': 0.16; 'tempted': 0.16; 'wraps': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'example': 0.22; 'header:User-Agent:1': 0.23; 'skip': 0.24; 'switch': 0.26; 'header :In-Reply-To:1': 0.27; 'am,': 0.29; 'thus': 0.29; 'went': 0.31; '>>>>': 0.31; 'default,': 0.31; 'disable': 0.31; 'cases': 0.33; 'not.': 0.33; 'but': 0.35; 'there': 0.35; 'charset:us-ascii': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'though,': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'ian': 0.60; 'received:173': 0.61; 'back': 0.62; 'more': 0.64; 'different': 0.65; 'here': 0.66; 'reply': 0.66; 'between': 0.67; 'useful.': 0.68; 'day': 0.76; 'confusion.': 0.84; 'ethan': 0.84; 'furman': 0.84; 'absolutely': 0.87; 'subject:Proposal': 0.91; 'lucas': 0.93
Date Thu, 03 Apr 2014 19:16:24 -0700
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: Yet Another Switch-Case Syntax Proposal
References <8084-1396540962-768613@sneakemail.com> <533DA72B.9010602@stoneleaf.us> <533E131F.6010907@mrabarnett.plus.com>
In-Reply-To <533E131F.6010907@mrabarnett.plus.com>
Content-Type text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - gator3304.hostgator.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - stoneleaf.us
X-BWhitelist no
X-Source-IP 173.12.184.233
X-Exim-ID 1WVtgo-0001ek-MJ
X-Source
X-Source-Args
X-Source-Dir
X-Source-Sender ([173.12.184.233]) [173.12.184.233]:45399
X-Source-Auth ethan+stoneleaf.us
X-Email-Count 1
X-Source-Cap dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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 <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8875.1396579281.18130.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1396579281 news.xs4all.nl 2845 [2001:888:2000:d::a6]:35546
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:69637

Show key headers only | View raw


On 04/03/2014 07:04 PM, MRAB wrote:
> On 2014-04-03 19:23, Ethan Furman wrote:
>> On 04/03/2014 09:02 AM, Lucas Malor wrote:
>>>
>>> In reply to Ian Kelly:
>>>>
>>>> Instead of disabling fallthrough by default, why not disable it all together?
>>>
>>> I was tempted but there are cases in which it's useful. An example
>>>
>>> switch day casein ("Monday", "Thursday", "Wednesday", "Tuesday", "Friday"):
>>>      gotowork = True
>>>      continue
>>> casein ("Monday", "Thursday", "Wednesday", "Tuesday", "Friday"):
>>>      daytype = "ferial"
>>> casein ("Saturday", "Sunday")
>>>      daytype = "festive"
>>
>>
>> Absolutely not.  Currently, the 'continue' key word means "stop processing and go back to the beginning".  You would
>> have it mean "keep going forward".  Thus 'continue' would mean both "go backwards" and "go forwards" and would lead to
>> unnecessary confusion.
>>
> I thought it went to the end of the loop, but because it's a loop, it
> just wraps around back to the top...

*sigh*  I see you are already confused.  ;)

Hmmmm.... I think that would be more like 'skip' as in 'skip to the end'...

Either way, though, 'continue' would mean two very different things:

  - skip everything between here and the end of the loop

  - don't skip everything between here and the end of the case

--
~Ethan~

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


Thread

Re: Yet Another Switch-Case Syntax Proposal Ethan Furman <ethan@stoneleaf.us> - 2014-04-03 19:16 -0700

csiph-web