Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ngallagher committed Feb 4, 2019
1 parent e955bd5 commit 920b121
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Here you will get an overview on how the interpreter works and the language.
* [Trait](#trait)
* [Module](#module)
* [Annotations](#annotations)
* [Type Alias](#type-alias)
* [Type Alias](#type-alias)
* [Uniform Access](#uniform-access)
* [Import](#import)
* [Coercion](#coercion)
* [Platform Integration](#platform-integration)
Expand Down Expand Up @@ -922,6 +923,36 @@ func bagOf<T: Number>(nums...: T): Bag<T> {
}
```
#### Uniform Access
The uniform access principle of computer programming was put forth by Bertrand Meyer.
It states all services offered by a module should be available through a uniform notation,
which does not betray whether they are implemented through storage or through computation.
An example of this is typical getter and setter property methods.
```js
class Person {
private const firstName;
private const surname;
new(firstName, surname) {
this.firstName = firstName;
this.surname = surname;
}
getFullName() {
return "${firstName} ${surname}";
}
}
let person = new Person("John", "Doe");
assert person.fullName == 'John Doe';
```
Uniform access applies to all implemented types as well as any external dependencies imported
regardless of their origin, for example the Java class libraries.
#### Import
In order to access the Java types available they can be imported by name. Once imported the type can be instantiated
Expand Down

0 comments on commit 920b121

Please sign in to comment.