summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/README.md b/README.md
index af8ec31..7def09c 100644
--- a/README.md
+++ b/README.md
@@ -340,6 +340,8 @@ impl Point {
#### Traits
Define shared behavior.
```zc
+struct Circle { radius: f32; }
+
trait Drawable {
fn draw(self);
}
@@ -347,6 +349,9 @@ trait Drawable {
impl Drawable for Circle {
fn draw(self) { ... }
}
+
+var circle = Circle{};
+var drawable: Drawable = &circle;
```
#### Composition