Skip to content

Commit c3f555a

Browse files
committed
List ..// under Macro.operator?/2
1 parent c46e14d commit c3f555a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/elixir/lib/macro.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,9 +1597,22 @@ defmodule Macro do
15971597

15981598
@doc """
15991599
Returns `true` if the given name and arity is an operator.
1600+
1601+
## Examples
1602+
1603+
iex> Macro.operator?(:not_an_operator, 3)
1604+
false
1605+
iex> Macro.operator?(:+, 1)
1606+
true
1607+
iex> Macro.operator?(:++, 2)
1608+
true
1609+
iex> Macro.operator?(:..//, 3)
1610+
true
1611+
16001612
"""
16011613
@doc since: "1.7.0"
16021614
@spec operator?(name :: atom(), arity()) :: boolean()
1615+
def operator?(:"..//", 3), do: true
16031616
def operator?(name, 2) when is_atom(name), do: Identifier.binary_op(name) != :error
16041617
def operator?(name, 1) when is_atom(name), do: Identifier.unary_op(name) != :error
16051618
def operator?(name, arity) when is_atom(name) and is_integer(arity), do: false

0 commit comments

Comments
 (0)