aboutsummaryrefslogtreecommitdiff
path: root/docs/channels.md
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-10-09 13:48:45 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-10-09 13:48:45 -0400
commit5a80ff0db3690943a522e38152c86393ab0eb594 (patch)
treee9acbe040b9216dc456b8d7f99852a42800ff998 /docs/channels.md
parent63d48e9febf2aa65de4cfd40489b05cbcdfd463a (diff)
Update docs to standardize function signature formatting
Diffstat (limited to 'docs/channels.md')
-rw-r--r--docs/channels.md48
1 files changed, 24 insertions, 24 deletions
diff --git a/docs/channels.md b/docs/channels.md
index 47b9ced4..ab61a82a 100644
--- a/docs/channels.md
+++ b/docs/channels.md
@@ -29,9 +29,9 @@ small_channel := |:Int; max_size=5|
**Description:**
Adds an item to the channel.
-**Usage:**
-```markdown
-give(channel:|T|, item: T, front: Bool = no -> Void)
+**Signature:**
+```tomo
+func give(channel:|T|, item: T, front: Bool = no -> Void)
```
**Parameters:**
@@ -44,7 +44,7 @@ give(channel:|T|, item: T, front: Bool = no -> Void)
Nothing.
**Example:**
-```markdown
+```tomo
>> channel:give("Hello")
```
@@ -55,9 +55,9 @@ Nothing.
**Description:**
Adds multiple items to the channel.
-**Usage:**
-```markdown
-give_all(channel:|T|, items: [T], front: Bool = no -> Void)
+**Signature:**
+```tomo
+func give_all(channel:|T|, items: [T], front: Bool = no -> Void)
```
**Parameters:**
@@ -70,7 +70,7 @@ give_all(channel:|T|, items: [T], front: Bool = no -> Void)
Nothing.
**Example:**
-```markdown
+```tomo
>> channel:give_all([1, 2, 3])
```
@@ -81,9 +81,9 @@ Nothing.
**Description:**
Removes and returns an item from the channel. If the channel is empty, it waits until an item is available.
-**Usage:**
-```markdown
-get(channel:|T|, front: Bool = yes -> T)
+**Signature:**
+```tomo
+func get(channel:|T|, front: Bool = yes -> T)
```
**Parameters:**
@@ -95,7 +95,7 @@ get(channel:|T|, front: Bool = yes -> T)
The item removed from the channel.
**Example:**
-```markdown
+```tomo
>> channel:peek()
= "Hello"
```
@@ -108,9 +108,9 @@ The item removed from the channel.
Returns the next item that will come out of the channel, but without removing
it. If the channel is empty, it waits until an item is available.
-**Usage:**
-```markdown
-peek(channel:|T|, front: Bool = yes -> T)
+**Signature:**
+```tomo
+func peek(channel:|T|, front: Bool = yes -> T)
```
**Parameters:**
@@ -122,7 +122,7 @@ peek(channel:|T|, front: Bool = yes -> T)
The item removed from the channel.
**Example:**
-```markdown
+```tomo
>> channel:get()
= "Hello"
```
@@ -134,9 +134,9 @@ The item removed from the channel.
**Description:**
Removes all items from the channel.
-**Usage:**
-```markdown
-clear(channel:|T| -> Void)
+**Signature:**
+```tomo
+func clear(channel:|T| -> Void)
```
**Parameters:**
@@ -147,7 +147,7 @@ clear(channel:|T| -> Void)
Nothing.
**Example:**
-```markdown
+```tomo
>> channel:clear()
```
@@ -158,9 +158,9 @@ Nothing.
**Description:**
Returns a list of all items currently in the channel without removing them.
-**Usage:**
-```markdown
-channel:view(->[T])
+**Signature:**
+```tomo
+func channel:view(->[T])
```
**Parameters:**
@@ -171,7 +171,7 @@ channel:view(->[T])
An array of items currently in the channel.
**Example:**
-```markdown
+```tomo
>> channel:view()
= [1, 2, 3]
```