[Grace-core] Type declarations

Timothy Jones tim at ecs.vuw.ac.nz
Wed Mar 19 23:55:22 PDT 2014


On 20/03, Kim Bruce wrote:
> > On Mar 20, 2014, at 7:26 AM, Timothy Jones <tim at ecs.vuw.ac.nz> wrote:
> > ... I also think this is more consistent with the notion that many
> > patterns which aren't interface declarations can also be static types.
> 
> Can you give examples?

Well, you can write your own static checkers, so anything can really be a type.
The brands are one example though: 'brand.Type' (or whatever we decide to call
it) is a static type as far as the brand checker is concerned, but it has no
structural type information encoded in it.

I'm working on the brands implementation at the moment, and I'm writing things
like:

  type Type = aPattern.new

The pattern is a regular object, but the associated dialect will treat it as a
type, so I'm declaring it as a type.

-- 
Tim


More information about the Grace-core mailing list