This repository has been archived by the owner on Apr 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
schema language
Konstantin Sobolev edited this page Jun 17, 2016
·
29 revisions
This is a draft page filled as we go with the language implementation
#Imports There are two kinds of imports: namespace imports and single type imports.
Single type import makes one single type from another package available:
import foo.bar.Baz
record R {
myField: Baz
}
Importing types with the same short name from different namespaces is not allowed:
import foo.bar.Baz
import qux.Baz // clash!
Namespace import brings given namespace into scope, so that namespace prefix can be omitted:
import foo.bar
record R {
myField: bar.Baz
}
Importing namespaces with the same last segment is not allowed:
import foo.bar
import qux.bar // clash!
The following imports are always implicitly present:
import epigraph.String
import epigraph.Integer
import epigraph.Long
import epigraph.Double
import epigraph.Boolean
Type references are resolved in the following order:
- Using explicit imports
- Using implicit (standard) imports
- Types from the same (current) namespace
See [References implementation](References implementation) for more technical details.
Type A
inherits type B
if they are of the same kind and one of the following
is true:
-
A
extendsB
-
B
supplementsA
A
is a member of a vartypeV
andB
supplementsV
-
A
inheritsT
, andT
inheritsB
(transitivity)