Skip to content

Commit

Permalink
🚧 Trying different syntax ideas
Browse files Browse the repository at this point in the history
semver: chore
  • Loading branch information
Lucas de Jong committed Oct 23, 2024
1 parent cdbe80d commit c0f2241
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
};
```

0 comments on commit c0f2241

Please sign in to comment.