Should the comma operator be removed in D2?
Justin Johansson
no at spam.com
Tue Nov 17 17:21:59 PST 2009
Ellery Newcomer wrote:
> Ellery Newcomer wrote:
>> Bill Baxter wrote:
>>> Yes, Yigal said basically that. The question I have is what practical
>>> difference does that make to the language?
>>> Seems no different from defining the empty tuple to be void, then
>>> renaming void to unit.
>>>
>>>
>>> --bb
>> If you have unit distinct from void, you could use it for what Andrei
>> mentioned a while back. Something to do with determining a function will
>> never return because it always throws, etc.
>
> then again, maybe not.
From my memory of Scala, the top and bottom types are called
Unit and Nothing respectively. Unit is analogous to C,C++,D,Java void
and Nothing is the type of that returned by a function that never
returns (in other words nothing). I think the latter (the Nothing type)
is what Andrei was talking about before.
FYI, a lot of articles about types systems are rather arduous to read
but I found this one written in more lay-speak by James Iry who is a
Scala advocate.
Getting to the Bottom of Nothing At All.
http://james-iry.blogspot.com/2009/08/getting-to-bottom-of-nothing-at-all.html
Enjoy the read; all about nothing, bits about tuples. No warranty for
academic accuracy though.
-- Justin Johansson
More information about the Digitalmars-d
mailing list