Rename the language from Dino to Rex
Files use .rex, the command is rex, and the crate, runtime prefixes, docs, editor files and examples all use the new name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f44f09b6a
commit
7cf9727bcd
94 files changed
+858
-858
No files matched your search
@@ -4,13 +4,13 @@
|
||||
|
||||
A struct groups related values. **Methods go inside the struct** and see the fields directly.
|
||||
|
||||
```dino
|
||||
```rex
|
||||
struct Player {
|
||||
name: string
|
||||
hp: int
|
||||
x, y: float // names in a row share a type
|
||||
|
||||
func hurt(amount: int) { // changes hp, so Dino knows it modifies the player
|
||||
func hurt(amount: int) { // changes hp, so Rex knows it modifies the player
|
||||
hp -= amount
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ method of the same struct (`hurt(2)`), then a global function.
|
||||
|
||||
### Structs are values
|
||||
|
||||
```dino
|
||||
```rex
|
||||
struct Point { x, y: int }
|
||||
|
||||
func main() {
|
||||
@@ -64,7 +64,7 @@ Point{x: 1, y: 2} Point{x: 99, y: 2}
|
||||
|
||||
### Methods that return values, and nested data
|
||||
|
||||
```dino
|
||||
```rex
|
||||
struct Vec2 {
|
||||
x, y: float
|
||||
|
||||
@@ -98,7 +98,7 @@ Vec2{x: 3.0, y: 1.0} [Vec2{x: 1.0, y: 1.0}] 10.0
|
||||
|
||||
An enum is "one of these cases", and each case can carry data.
|
||||
|
||||
```dino
|
||||
```rex
|
||||
enum Event {
|
||||
Quit
|
||||
Key(code: int)
|
||||
|
||||
Reference in new issue
Block a user