[Grace-core] Inheritance and Template Objects
Andrew P. Black
black at cs.pdx.edu
Wed Apr 3 21:30:42 PDT 2013
On 3 Apr 2013, at 18:28, James Noble wrote:
> not sure here. I'll accept it for now, but if they really were nominal, I think it breaks your interval example as the two templates would have different nominal types. But I think I know what you mean - perhaps something like singleton types?? - which is fine.
What I meant was: the only templates are those generated by the template mechanism in the language. I can't cons up a new object out of whole cloth and have it be a template, even if it does have all of the right methods. Maybe "branded" is a better word.
If you plan to use template types to do type inference, then
template { method a -> Number ; method b -> Done }
better have the same type as
template template { method a -> Number } + template { method b -> Done }
I thought of doing this using flow analysis and constant propagation, rather than type checking, but I can see that you could use type checking.
> myObject.template or mirrors.templateOf(Object)
>
> do you think of this as as base-level operation or a metal-level operation -
>
Getting a template from an object is clearly a meta-level operation. But then, so is inheritance. So I think that's OK.
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20130403/ca0a9c54/attachment.html>
More information about the Grace-core
mailing list