diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-10-09 13:48:45 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-10-09 13:48:45 -0400 |
| commit | 5a80ff0db3690943a522e38152c86393ab0eb594 (patch) | |
| tree | e9acbe040b9216dc456b8d7f99852a42800ff998 /docs/README.md | |
| parent | 63d48e9febf2aa65de4cfd40489b05cbcdfd463a (diff) | |
Update docs to standardize function signature formatting
Diffstat (limited to 'docs/README.md')
| -rw-r--r-- | docs/README.md | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/docs/README.md b/docs/README.md index e4449365..1f636bc2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -42,9 +42,9 @@ Information about Tomo's built-in types can be found here: **Description:** Gets a line of user input text with a prompt. -**Usage:** -```markdown -ask(prompt:Text, bold:Bool = yes, force_tty:Bool = yes -> Void) +**Signature:** +```tomo +func ask(prompt:Text, bold:Bool = yes, force_tty:Bool = yes -> Void) ``` **Parameters:** @@ -65,7 +65,7 @@ A line of user input text without a trailing newline, or empty text if something went wrong (e.g. the user hit `Ctrl-D`). **Example:** -```markdown +```tomo >> ask("What's your name? ") = "Arthur Dent" ``` @@ -77,9 +77,9 @@ something went wrong (e.g. the user hit `Ctrl-D`). **Description:** Exits the program with a given status and optionally prints a message. -**Usage:** -```markdown -ask(message:Text? = !Text, status:Int32 = 1[32] -> Void) +**Signature:** +```tomo +func ask(message:Text? = !Text, status:Int32 = 1[32] -> Void) ``` **Parameters:** @@ -93,7 +93,7 @@ ask(message:Text? = !Text, status:Int32 = 1[32] -> Void) This function never returns. **Example:** -```markdown +```tomo exit(status=1, "Goodbye forever!") ``` @@ -104,9 +104,9 @@ exit(status=1, "Goodbye forever!") **Description:** Prints a message to the console. -**Usage:** -```markdown -say(text:Text, newline:Bool = yes -> Void) +**Signature:** +```tomo +func say(text:Text, newline:Bool = yes -> Void) ``` **Parameters:** @@ -118,7 +118,7 @@ say(text:Text, newline:Bool = yes -> Void) Nothing. **Example:** -```markdown +```tomo say("Hello ", newline=no) say("world!") ``` @@ -130,9 +130,9 @@ say("world!") **Description:** Pause execution for a given number of seconds. -**Usage:** -```markdown -sleep(seconds: Num -> Void) +**Signature:** +```tomo +func sleep(seconds: Num -> Void) ``` **Parameters:** @@ -143,7 +143,7 @@ sleep(seconds: Num -> Void) Nothing. **Example:** -```markdown +```tomo sleep(1.5) ``` @@ -154,9 +154,9 @@ sleep(1.5) **Description:** Prints a message to the console, aborts the program, and prints a stack trace. -**Usage:** -```markdown -fail(message:Text -> Abort) +**Signature:** +```tomo +func fail(message:Text -> Abort) ``` **Parameters:** @@ -167,7 +167,7 @@ fail(message:Text -> Abort) Nothing, aborts the program. **Example:** -```markdown +```tomo fail("Oh no!") ``` @@ -178,9 +178,9 @@ fail("Oh no!") **Description:** Gets the current time. This is an alias for `DateTime.now()`. -**Usage:** -```markdown -now(->DateTime) +**Signature:** +```tomo +func now(->DateTime) ``` **Parameters:** @@ -191,7 +191,7 @@ None. The current moment as a DateTime. **Example:** -```markdown +```tomo >> now() = Sun Sep 29 20:12:33 2024 ``` |
