Macro.quoted_literal-question-mark

You're seeing just the function quoted_literal-question-mark, go back to Macro module for more information.
Link to this function

quoted_literal?(term)

View Source (since 1.7.0)

Specs

quoted_literal?(t()) :: boolean()

Returns true if the given quoted expression represents a quoted literal.

Atoms, numbers, and functions are always literals. Binaries, lists, tuples, maps, and structs are only literals if all of their terms are also literals.

Examples

iex> Macro.quoted_literal?(quote(do: "foo"))
true
iex> Macro.quoted_literal?(quote(do: {"foo", 1}))
true
iex> Macro.quoted_literal?(quote(do: {"foo", 1, :baz}))
true
iex> Macro.quoted_literal?(quote(do: %{foo: "bar"}))
true
iex> Macro.quoted_literal?(quote(do: %URI{path: "/"}))
true
iex> Macro.quoted_literal?(quote(do: URI.parse("/")))
false
iex> Macro.quoted_literal?(quote(do: {foo, var}))
false