Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #69637
| Date | 2014-04-03 19:16 -0700 |
|---|---|
| From | Ethan Furman <ethan@stoneleaf.us> |
| Subject | Re: Yet Another Switch-Case Syntax Proposal |
| References | <8084-1396540962-768613@sneakemail.com> <533DA72B.9010602@stoneleaf.us> <533E131F.6010907@mrabarnett.plus.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.8875.1396579281.18130.python-list@python.org> (permalink) |
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
Re: Yet Another Switch-Case Syntax Proposal Ethan Furman <ethan@stoneleaf.us> - 2014-04-03 19:16 -0700
csiph-web