diff --git a/readme.md b/readme.md index 052d3ec..81673ce 100644 --- a/readme.md +++ b/readme.md @@ -25,27 +25,30 @@ code purrer for cat: ``` ```rust -comp Name: +type Name: name ~ string; -comp Age: age ~ number; +type Age: + age ~ number; -enum tail_length: - short, - medium, +enum Tail: + none + medium long; -type Cat - tail_length ~ tail_length, - + Name, - + Age; +type Cat with Name, Age: + sleep_count ~ number + tail_length ~ Tail.none; spec Purrer: pur ~ fn(self) -> number; -code Purrer for Cat: +code Purrer Cat: fn pur(self) -> number { print`($"{self.name} ({self.age}) is purring"); - }; + } + fn sleep(self) { + self.sleep_count++; + }; ```