Skip to content

chain/1 disappears from iex #100

@florius0

Description

@florius0

If chain/1 is called inside iex session once and I try to call it the second time, Elixir tells that chain/1 does not exist. use Witchcraft or use Witchcraft.Chain fixes it.

Erlang/OTP 24 [erts-12.1.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit] [dtrace]

Interactive Elixir (1.12.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> use Witchcraft
Witchcraft
iex(2)> chain do
...(2)> [1,2,3]
...(2)> [4,5,6]
...(2)> end
[4, 5, 6, 4, 5, 6, 4, 5, 6]
iex(3)> chain do
...(3)> [1,2,3]
...(3)> [4,5,6]
...(3)> end
** (CompileError) iex:3: undefined function chain/1

iex(3)> use Witchcraft
Witchcraft
iex(4)> chain do
...(4)> [1,2,3]
...(4)> [4,5,6]
...(4)> end
[4, 5, 6, 4, 5, 6, 4, 5, 6]
iex(5)> chain do
...(5)> [1,2,3]
...(5)> [4,5,6]
...(5)> end
** (CompileError) iex:5: undefined function chain/1

iex(5)>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions