🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #312

Re: case()

#312
From: Bob ATKINSON
Date: Mon, 13 Aug 1990 18:12
31 lines
1437 bytes
In article <26857@pasteur.Berkeley.EDU> bilmes@icsib (Jeff Bilmes) writes:
>In article <26842@pasteur.Berkeley.EDU> krste@ICSI.Berkeley.EDU ( Krste Asanovic) writes:
>>The C/C++ switch statement is very limited as it only allows integer
>>expressions. 
...
>
>This does not warrant
>extending the language when you can do the semantic equivalent as
>easily as:
>
>    if (exp == val1) 
>	s1 
>    else if (exp == val2)
>	s2
>    else if (exp == val3 || exp == val4 || exp == val5 || ...)
>	s3
>    ...

By this logic, switch statements should not have been invented
in the first place.  Clearly in C a need was felt for this syntactic
sugar.  Krste was merely pointing out that one can argue that
the same needs can motivate a similar extension for non-integral
types, of which there are a significantly larger number in C++
(that have equality operators) than in C.

I guess I don't feel particularly strongly about this issue;
I just felt the reasoning being used was flawed.


	Bob Atkinson
	Microsoft
Technical Details
Message-ID: <56515@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!microsoft!bobatk
References: <26842@pasteur.Berkeley.EDU> <26857@pasteur.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!microsoft!bobatk
From: bobatk@microsoft.UUCP (Bob ATKINSON)
Newsgroups: comp.std.c++
Subject: Re: case()
Keywords: case statement
Message-ID: <56515@microsoft.UUCP>
Date: 13 Aug 90 18:12:18 GMT
References: <26842@pasteur.Berkeley.EDU> <26857@pasteur.Berkeley.EDU>
Reply-To: bobatk@microsoft.UUCP (Bob ATKINSON)
Organization: Microsoft Corp., Redmond WA
Lines: 31