elixirian · elixir · recipes · iex · compile

Elixiran | Recipes | Recipe 3: Compile module directly in IEx

Have a quick helper or experiment?


🍳 Recipe 3: Run Elixir Scripts from IEx with c(“file.ex”)

# greeter.ex
defmodule Greeter do
  def hello(name), do: "Hello, #{name}!"
end

in iex shell

c("greeter.ex")
Greeter.hello "World"

recipe 3, 1: compile module in IEx

✅ This is great for testing modules quickly before integrating them into a larger app.