[Grace-core] [A Graceful Blog] Comment: "From Lancaster to Portland"

Andrew P. Black black at cs.pdx.edu
Mon Sep 26 14:53:32 PDT 2011


On 26 Sep 2011, at 14:39, James Noble wrote:

>> Big Mistake from Emerald: having a distinguished object whose type is None.
> 
> Ok - so what do you suggest instead...

The type None is uninhabited (as it's name suggests it should be).

> 
>> It's equivalent to Tony Hoare's "Billion dollar mistake", although of course, our's wasn't nearly that expensive.  Maybe $50.42 :-)
> 
> I thought Tony's mistake was *not* having such an object - or rather, permitting nil in every type.

That's right.  If there is an object of type None, where None is the Top of the type (operations) lattice, then None does indeed inhabit every type.  So None can be asssigend to any variable.

> 
> Grace's types will distinguish between types that include nil, and types that don't. 

In which case, nil can't be of type None.  instead, it must be a "non object", as in Eiffel.   

Isn't it annoying when one realizes that Bertrand is right ;-)

	Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20110926/3a60c17a/attachment.html>


More information about the Grace-core mailing list