About switch case statements...

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Nov 16 15:39:26 PST 2009


Ellery Newcomer wrote:
> Andrei Alexandrescu wrote:
>> Ellery Newcomer wrote:
>>> Andrei Alexandrescu wrote:
>>>> Ellery Newcomer wrote:
>>>>> KennyTM~ wrote:
>>>>>> throw ...;
>>>>>> assert(...);
>>>>>>
>>>>> you can call functions which do these...
>>>> ... which is where the "none"/"bottom" type comes into play!
>>>>
>>>> Andrei
>>> What what?
>> http://en.wikipedia.org/wiki/Bottom_type
>> http://www.cs.washington.edu/research/projects/cecil/www/Release/doc-cecil-stdlib/node4.html
>>
>>
>> I gave a talk about similar stuff once but I don't know where it is. I
>> also have 70% of an article on it written (and with a funny introduction
>> to boot) but I couldn't find the time * interest to finish.
>>
>>
>> Andrei
> 
> So a function that always throws should have a result type (maximal
> type?) of bottom type?

Yah, because it never actually returns. Functions like abort() or exit() 
would return bottom in a type system that supports it.

Andrei



More information about the Digitalmars-d mailing list