• Eric Myhre's avatar
    Each 'Type*' now has read-only methods. · c9cf2100
    Eric Myhre authored
    ...and all fields are correspondingly unexported.
    
    We're going full immutability on almost all this stuff.  I simply can't
    imagine handling and maintaining this any other way.
    
    The typesystem.Type interface also got a few more standard methods.
    I'm not sure if having a Universe backpointer is going to be useful
    very often or not, but it seems reasonable enough to do; we'll
    definitely *have* that information during consistency checking and
    reification time, so it should turn out easy to keep it.
    
    The validate_test.go code is now looking a bit janky.  We need
    initializers for the typesystem.Type* values.  Those will be the
    typedeclaration.* package... which we'll write next.
    
    Note that I skipped any accessor methods on `Type*` objects which are
    for representation details.  These might get filled in later, but I'm
    gonna see how far I can get without them.  (So far, there's some
    uses of the representation details in the validate method, but we've
    located that in the typesystem package anyway, so that's... fine.)
    Signed-off-by: default avatarEric Myhre <hash@exultant.us>
    c9cf2100
typeMethods.go 4.44 KB