@@ -5696,16 +5696,15 @@ defmodule Kernel do
5696
5696
end
5697
5697
5698
5698
@ doc """
5699
- Generates a macro suitable for use in guard expressions.
5699
+ Defines a macro suitable for use in guard expressions.
5700
5700
5701
- It raises at compile time if the definition uses expressions that aren't
5702
- allowed in guards, and otherwise creates a macro that can be used both inside
5703
- or outside guards.
5701
+ It raises at compile time if the `guard` uses expressions that aren't
5702
+ allowed in [guard clauses](patterns- and-guards.html#guards),
5703
+ and otherwise creates a macro that can be used both inside or outside guards.
5704
5704
5705
- Note the convention in Elixir is to prefix all guards that return a boolean
5706
- with the `is_` prefix, such as `is_list/1`. If, however, the function/macro
5707
- returns a boolean and is not allowed in guards, it should have no prefix and
5708
- end with a question mark, such as `Keyword.keyword?/1`.
5705
+ When defining your own guards, consider the
5706
+ [naming conventions](naming-conventions.html#is_-prefix-is_foo)
5707
+ around boolean-returning guards.
5709
5708
5710
5709
## Example
5711
5710
@@ -5742,12 +5741,17 @@ defmodule Kernel do
5742
5741
end
5743
5742
5744
5743
@ doc """
5745
- Generates a private macro suitable for use in guard expressions.
5744
+ Defines a private macro suitable for use in guard expressions.
5746
5745
5747
- It raises at compile time if the definition uses expressions that aren't
5748
- allowed in guards, and otherwise creates a private macro that can be used
5746
+ It raises at compile time if the `guard` uses expressions that aren't
5747
+ allowed in [guard clauses](patterns-and-guards.html#guards),
5748
+ and otherwise creates a private macro that can be used
5749
5749
both inside or outside guards in the current module.
5750
5750
5751
+ When defining your own guards, consider the
5752
+ [naming conventions](naming-conventions.html#is_-prefix-is_foo)
5753
+ around boolean-returning guards.
5754
+
5751
5755
Similar to `defmacrop/2`, `defguardp/1` must be defined before its use
5752
5756
in the current module.
5753
5757
"""
0 commit comments