Skip to content

Commit

Permalink
Add docs to Kernel.if/2
Browse files Browse the repository at this point in the history
  • Loading branch information
dvic committed Nov 20, 2023
1 parent df66d88 commit 023361a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/elixir/lib/kernel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3773,11 +3773,13 @@ defmodule Kernel do
var
end

@doc """
@doc ~S"""
Provides an `if/2` macro.
This macro expects the first argument to be a condition and the second
argument to be a keyword list.
argument to be a keyword list. Similar to `case/2`, any assignment in
the condition will be available on both clauses, as well as after the
if statement.
## One-liner examples
Expand Down

0 comments on commit 023361a

Please sign in to comment.