Revise docs.

This commit is contained in:
Stephen Chung
2020-06-25 11:07:56 +08:00
parent 58c198776f
commit aeb47efce8
11 changed files with 99 additions and 41 deletions

View File

@@ -10,13 +10,20 @@ New definitions _overwrite_ previous definitions of the same name and number of
```rust
fn foo(x,y,z) { print("Three!!! " + x + "," + y + "," + z) }
fn foo(x) { print("One! " + x) }
fn foo(x,y) { print("Two! " + x + "," + y) }
fn foo() { print("None.") }
fn foo(x) { print("HA! NEW ONE! " + x) } // overwrites previous definition
foo(1,2,3); // prints "Three!!! 1,2,3"
foo(42); // prints "HA! NEW ONE! 42"
foo(1,2); // prints "Two!! 1,2"
foo(); // prints "None."
```