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

Andrew P. Black black at cs.pdx.edu
Mon Sep 26 11:15:02 PDT 2011


On 25 Sep 2011, at 4:11, James Noble wrote:

>> The first thing that comes to me is that, since James assures me
>> that there is no tagging of union types, other than the
>> fact that ALL objects are tagged, that the type Option[T]
>> is essentially equal to None: The None type permits any object
>> (it is the empty structural object type).  Thus anything can be
>> passed to something of type Option[T].
> 
> Ah. Yes - "type None = { }"  would do just that.
> 
> This code was derived I think from Scala originally - so
> "None" here is a singleton object type - it will match
> *just* that particular empty object.   [[Hmm. orthogonal point:
> actually it would match any empty object since we can't
> distinguish different "instances" of value objects]]

My "naming alarm" has just gone off.

Surely, the type that permits any object should be called "Any", not None!
It's bottom in the lattice of sets of operations (or top in the lattice of sets of elements).
The other end of the lattice is what I would expect to be called "None": it's the type containing contradictory information about the object, and consequently permits no real object.  None is therefore the Top of the lattice of operations (or the Bottom of the lattice of sets of elements.)

Remember, we have to be able to explain this stuff to students.  If I were  novice student, I would be very confused to find out that a type called None would accept anything.

	Andrew

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


More information about the Grace-core mailing list