[Grace-core] Minutes of Teleconference 2011.11.30

Michael Homer mwh at ecs.vuw.ac.nz
Wed Nov 30 18:26:51 PST 2011


On Thu, Dec 1, 2011 at 2:28 PM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
> * talked about Michael's "Polymorphism over unit" message
>
> * switch design to return "none" vs not returning anything etc...
>
>  "none" is a trivial value object - that understands no messages etc.
>  assuming singleton types work, this can be used as a singleton type "none"
>
>  now every method request  returns a value, even if that value is none. none is assignable to suitably typed variables.
>  primitive assignments return "none"
>  most control structures (especially while, for)  return "none"
>    if then else & match can just return the value of the block that was executed (which may or may not be "none")
>   a method that ends returns the value of the last expression/statement (which may or may not be "none")
>   writing just "return" returns none
>      leaving off the "->" in a method declaration means -> *Dynamic*
>
> And then:
>  * Andrew's solution in dynamic world - that somehow applies at only lower language levels
>      dynamic checks on assignment & parameter passing
>       that prevent assigning "none" to a variable, or passing "none" down as a method argument.
>       return values are *not* restricted...
>
>  * Kim's solution in the static world - if you could have a *none*, you'll need to mention that in the types
>      (one way or another)
For clarity - is the value of uninitialised variables a distinct
"undefined" which is always an error to use? Or is it now the real
value "none" as well? It doesn't seem to cause any problem, but it is
a second kind of non-value.
-Michael


More information about the Grace-core mailing list