Skip to content

Commit 8da48af

Browse files
committed
Document delete_attribute+accumulate, closes #11635
1 parent 8d06ee8 commit 8da48af

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/elixir/lib/module.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,14 @@ defmodule Module do
15111511
end
15121512

15131513
@doc """
1514-
Deletes the module attribute that matches the given key.
1514+
Deletes the entry (or entries) for the given module attribute.
15151515
1516-
It returns the deleted attribute value (or `nil` if nothing was set).
1516+
It returns the deleted attribute value. If the attribute has not
1517+
been set nor configured to accumulate, it returns `nil`.
1518+
1519+
If the attribute is set to accumulate, then this function always
1520+
returns a list. Deleting the attribute removes existing entries
1521+
but the attribute will still accumulate.
15171522
15181523
## Examples
15191524

0 commit comments

Comments
 (0)