Feb. 9th, 2014
wrote something about logic
Feb. 9th, 2014 10:49 amhttps://docs.google.com/document/d/1Q9efn1ErGXJE_K9IO0YrquAWS8SO8MsXpZcan_8Z5Jk/edit?usp=sharing
It's pretty primitive, and may be as well wrong in places...
It's pretty primitive, and may be as well wrong in places...
just got it
Feb. 9th, 2014 07:38 pmIn 2009 James Iry wrote about
I got the idea eventually
If you have an empty class, it is the initial object (aka bottom); and in OOP there's probably no way to even express the idea.
Kind of obvious, right? Null has a value, hence it is not an initial object (Daniel Spiewak probably meant something else); anything that has a value is no good.
Void is not a good candidate either, but it could be, if it were not owned by Java.
Nothing
type in Scala: http://james-iry.blogspot.com/2009/08/getting-to-bottom-of-nothing-at-all.htmlI got the idea eventually
If you have an empty class, it is the initial object (aka bottom); and in OOP there's probably no way to even express the idea.
Kind of obvious, right? Null has a value, hence it is not an initial object (Daniel Spiewak probably meant something else); anything that has a value is no good.
Void is not a good candidate either, but it could be, if it were not owned by Java.
scala> def nothingness: Nothing = {println("This is nothingness");throw new RuntimeException("byte me")} nothingness: Nothing scala> def vacuum:Void = {println("you are in space, char!"); throw new RuntimeException("I am void but not null")} vacuum: Void scala> def eatSpace(space:Void) = { println("I eat space"); println("and I got " + space)} eatSpace: (space: Void)Unit scala> eatSpace(vacuum) you are in space, char! java.lang.RuntimeException: I am void but not null at .vacuum(:7) at . ( :10) at . ( ) at . ( :7) at . ( ) at $print( ) // etc scala> eatSpace(nothingness) This is nothingness java.lang.RuntimeException: byte me at .nothingness( :7) at . ( :10) at . ( ) at . ( :7) at . ( ) at $print( ) //etc