Hi @wktdev - yes, Elixir is a functional language. You should be able to run publicly defined functions from anywhere. Make sure they are defined with def (public) rather than defp (private). Also, make sure the argument count matches between how they are defined and how they are called:
def speak(words) do
IO.inspect(words)
end
will be defined as AppWeb.PageLive.speak/1, and should be called like this:
AppWeb.PageLive.speak("Something profound")
whereas
def speak() do
IO.inspect("Something random")
end
will be defined as AppWeb.PageLive.speak/0 and should be called like this:
I figure I could. I never run functions from the “AppWeb” directory in the terminal and gave it a shot earlier. I got an error that I didn’t understand and misdiagnosed. It was because of something else entirely.