IEx.Helpers.c
You're seeing just the function
c
, go back to IEx.Helpers module for more information.
Compiles the given files.
It expects a list of files to compile and an optional path to write the compiled code to. By default files are in-memory compiled. To write compiled files to the current directory, an empty string can be given.
It returns the names of the compiled modules.
If you want to recompile an existing module, check r/1
instead.
Examples
In the example below, we pass a directory to where the c/2
function will
write the compiled .beam
files to. This directory is typically named "ebin"
in Erlang/Elixir systems:
iex> c(["foo.ex", "bar.ex"], "ebin")
[Foo, Bar]
When compiling one file, there is no need to wrap it in a list:
iex> c("baz.ex")
[Baz]