[Grace-core] Minutes of Telecom 17-18.5.2012

James Noble kjx at ecs.vuw.ac.nz
Tue May 22 02:31:20 PDT 2012


> Apologies if I'm belaboring the obvious...

no it's all fine, and it's good for us to be clear about our motivations for things.

>  '()', or 'tt

we thought about these, and one question was "how do you pronounce them?"

> Also, it would be useful to have a type Nothing that truly has no values. This would be the return type of methods that never return, like exit. This informs the type checker that subsequent code is unreachable, so that it doesn't complain about missing result values etc.

that's a good point - I don't know if Nothing is the best name for it, rather than 
NeverReturns or something?  NoExit?  

the big problem with the name "Nothing" is that in Grace you can write nothing*
instead of a type - if you just leave the type out, you get type Dynamic* on inputs,
or an inferred type on outputs.   But writing the world "Nothing" means something
rather different than writing "" nothing.    See - it's even hard to write about! 

* we could be pickier here, distinguishing between writing no type annotation
  
       method foo(x) {z := x}
 
or writing an annotation that itself is the empty string 

       method bar(x :) -> {x + x}


so e.g. bar could mean "returns noSuchValue"   (or noUsefulValue)  
while foo's return type could mean "does not return" 

but, again, we figured that was a distinction that would be very hard to explain.

> Update: The penny drops :-) Of course, None refers to Some|None, the option type. Yes, that makes perfect sense. Sorry for being slow :-)


Umm, I think so?    in Grace we're untagged, so we'd do   e.g. String|None
(or, if noSuchValue is self matching, we have the option of String|noSuchValue) 
Although I do recall a discussion saying we didn't want noSuchValue to actually
*be* a useful null...  (e.g. perhaps it doesn't even understand == or something)

James


More information about the Grace-core mailing list