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 9a5c008..fda328d 100644
--- a/README.md
+++ b/README.md
@@ -338,6 +338,8 @@ impl Point {
#### Traits
Define shared behavior.
```zc
+struct Circle { radius: f32; }
+
trait Drawable {
fn draw(self);
}
@@ -345,6 +347,9 @@ trait Drawable {
impl Drawable for Circle {
fn draw(self) { ... }
}
+
+var circle = Circle{};
+var drawable: Drawable = &circle;
```
#### Composition