Re: Simon's switch-a-like for Python
Message Details
Posted
5/7/2004; 11:30 AM by Jim RoepckeLast Modified
5/7/2004; 11:30 AM by Jim RoepckeIn Response To
Re: Simon's switch-a-like for Python (#6857)Label
Computers-GeneralRead Count
261
Message Body
On May 7, 2004, at 8:21 AM, Greg Pierce wrote:
> On May 7, 2004, at 7:20 AM, Seth Dillingham wrote:
>
>> UserTalk has 'case', which is just like 'switch' in other languages.
>
> well, it's not "just like" switch, although it's very close.
>
> every other switch i've used requires you to explicitly break the
> evaluation chain to prevent further cases from being evaluated.
>
> ok, that's nitpicking. i'll shut up. ;-)
Pascal's doesn't (thankfully). I've always thought it was annoying
that some languages make you explicitly break out of cases. Perhaps
there are some clever things you can do when the language allows you to
drop into other cases, but most of the time that's not what you want.
Jim
> On May 7, 2004, at 7:20 AM, Seth Dillingham wrote:
>
>> UserTalk has 'case', which is just like 'switch' in other languages.
>
> well, it's not "just like" switch, although it's very close.
>
> every other switch i've used requires you to explicitly break the
> evaluation chain to prevent further cases from being evaluated.
>
> ok, that's nitpicking. i'll shut up. ;-)
Pascal's doesn't (thankfully). I've always thought it was annoying
that some languages make you explicitly break out of cases. Perhaps
there are some clever things you can do when the language allows you to
drop into other cases, but most of the time that's not what you want.
Jim
Replies
None.




