wslでelixir その6

# 概要
wsl(wsl2じゃない)で、elixirやってみた。
mixでmoduleが2つの時、どうすんだろ。

# 使ったコード

https://qiita.com/ohisama@github/items/026f10172d943979ff12


# moduleが2つの時の手順


```
$ mix new forth
* creating README.md
* creating .formatter.exs
* creating .gitignore
* creating mix.exs
* creating lib
* creating lib.ex
* creating test
* creating test/test_helper.exs
* creating test_test.exs

Your Mix project was created successfully.
You can use "mix" to compile it, test it, and more:

    cd forth
    mix test

Run "mix help" for more commands.


$ cd forth
$ mix test
Compiling 1 file (.ex)
Generated forth app
..

Finished in 0.3 seconds (0.00s async, 0.3s sync)
1 doctest, 1 test, 0 failures

Randomized with seed 844945


```
- /libに、main.exを追加する。

# 実行結果

```
$ iex -S mix
Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

Compiling 2 files (.ex)
warning: variable "stack" is unused (there is a variable with the same name in the context, use the pin operator (^) to match on it or prefix this variable with underscore if it is not meant to be used)
  lib.ex:28: Forth.add/0

warning: variable "stack" is unused (there is a variable with the same name in the context, use the pin operator (^) to match on it or prefix this variable with underscore if it is not meant to be used)
  lib.ex:36: Forth.sub/0

warning: variable "stack" is unused (there is a variable with the same name in the context, use the pin operator (^) to match on it or prefix this variable with underscore if it is not meant to be used)
  lib.ex:44: Forth.mul/0

warning: variable "stack" is unused (there is a variable with the same name in the context, use the pin operator (^) to match on it or prefix this variable with underscore if it is not meant to be used)
  lib.ex:52: Forth.div/0

warning: variable "stack" is unused (there is a variable with the same name in the context, use the pin operator (^) to match on it or prefix this variable with underscore if it is not meant to be used)
  lib.ex:64: Forth.drop/0

Generated forth app
Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Forth.start_link
{:ok, #PID<0.185.0>}
iex(2)> Main.run("9 9 - 9 9 / .")
1.0
[:ok, :ok, :ok, :ok, :ok, :ok, 1.0]
iex(3)> Main.run("9 9 / 9 9 / + .")
2.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, 2.0]
iex(4)> Main.run("9 9 + 9 + 9 / .")
3.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, 3.0]
iex(5)> Main.run("9 9 9 + 9 / dup + .")
4.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, 4.0]
iex(6)> Main.run("9 9 9 + 9 / dup + - .")
5.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, 5.0]
iex(7)> Main.run("9 dup 9 + 9 + 9 / - .")
6.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, 6.0]
iex(8)> Main.run("9 9 9 + 9 / - .")
7.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, 7.0]
iex(9)> Main.run("9 9 9 drop 9 / - .")
8.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, 8.0]
iex(10)> Main.run("9 9 - 9 * 9 + .")
9
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, 9]
iex(11)> Main.run("9 9 / 9 dup 9 / + .")
10.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, 10.0]
iex(12)> Main.run("9 9 9 + 9 / + .")
11.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, 11.0]
iex(13)> Main.run("9 dup 9 9 + + 9 / + .")
12.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, 12.0]
iex(14)> Main.run("9 9 9 + 9 / dup + + .")
13.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, 13.0]
iex(15)> Main.run("9 dup 9 9 + 9 / dup + - + .")
14.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, 14.0]
iex(16)> Main.run("9 dup dup 9 + 9 + 9 / - + .")
15.0
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, 15.0]
iex(17)>


```

以上。