How do I run a beam file compiled by Elixir or Erlang?

前端 未结 3 497
一整个雨季
一整个雨季 2021-01-30 13:58

I have installed Erlang/OTP and Elixir, and compiled the HelloWorld program into a BEAM using the command:

elixirc test.ex

Which produced a fil

3条回答
  •  無奈伤痛
    2021-01-30 14:38

    To specifically address the question:

    $ elixirc test.ex
    

    will produce a file named Elixir.Hello.beam, if the file defines a Hello module.

    If you run elixir or iex from the directory containing this file, the module will be available. So:

    $ elixir -e Hello.some_function
    

    or

    $ iex
    
    iex(1)> Hello.some_function
    

提交回复
热议问题