--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/elixir-lang-core/D569DB44-82DA-415B-9DA9-36509C179497%40wojtekmach.pl.
iex(10)> [1, 2, 3]
[1, 2, 3]
iex(11)> i
Term
[1, 2, 3]
Data type
List
Reference modules
List
Implemented protocols
Collectable, Enumerable, IEx.Info, Inspect, List.Chars, String.Chars
iex(12)> h Enumerable
defmacro sigil_w(term, modifiers)
Handles the sigil ~w for list of words.
It returns a list of "words" split by whitespace. Character unescaping and
interpolation happens for each word.
## Modifiers
• s: words in the list are strings (default)
• a: words in the list are atoms
• c: words in the list are charlists
## Examples
iex> ~w(foo #{:bar} baz)
["foo", "bar", "baz"]
iex> ~w(foo #{" bar baz "})
["foo", "bar", "baz"]
iex> ~w(--source test/enum_test.exs)
["--source", "test/enum_test.exs"]
iex> ~w(foo bar baz)a
[:foo, :bar, :baz]
iex> ~w(foo bar baz)c
[~c"foo", ~c"bar", ~c"baz"]
iex> Kernel.sigil_w(<<"foo bar baz">>, 'c')
[~c"foo", ~c"bar", ~c"baz"]
h is_odd
defmacro is_odd(integer)
guard: true
Determines if integer is odd.
Returns true if the given integer is an odd number, otherwise it returns false.
Allowed in guard clauses.
## Examples
iex> Integer.is_odd(5)
true
iex> Integer.is_odd(6)
false
iex> Integer.is_odd(-5)
true
iex> Integer.is_odd(0)
false