Skip to content

Commit 3f1e222

Browse files
committed
Improve documentation for Process.delete/1
I added a description of the return value of this function as well as some examples of its usage.
1 parent bba20dc commit 3f1e222

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/elixir/lib/process.ex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ defmodule Process do
8888

8989
@doc """
9090
Deletes the given `key` from the process dictionary.
91+
92+
Returns the value that was under `key` in the process dictionary,
93+
or `nil` if `key` was not stored in the process dictionary.
94+
95+
## Examples
96+
97+
Process.put(:comments, ["comment", "other comment"])
98+
Process.delete(:comments)
99+
#=> ["comment", "other comment"]
100+
Process.delete(:comments)
101+
#=> nil
102+
91103
"""
92104
@spec delete(term) :: term | nil
93105
def delete(key) do

0 commit comments

Comments
 (0)