Skip to content

Commit

Permalink
Add use syntax documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
imaqtkatt committed Mar 15, 2024
1 parent 8cc2e54 commit 2dabbfb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@ A let term binds some value to the next term, in this case `(* result 2)`:
let result = (+ 1 2); (* result 2)
```

The use term inline clones of some value to the next term:
```rs
use result = (+ 1 2); (* result result)

// Equivalent to
(* (+ 1 2) (+ 1 2))
```
The same term with `let` duplicates the value:
```rs
let result = (+ 1 2); (* result result)

// Equivalent to
let {result_1 result_2} = (+ 1 2); (* result_1 result_2)
```

It is possible to define tuples:
```rs
tup = (2, 2)
Expand Down

0 comments on commit 2dabbfb

Please sign in to comment.