title: Elixir, using function from another module
body: <p>I am extremly new to the programming and to the elixir. So I am very exited to learn as much as i can. But ive got a trouble. I looking the way how to use my functions in another module. I am building the web-server wich stores the key-value maps in the memory. To keep the maps temporary Ive decided to use Agent. Here is the part of my code: </p>
  
  <pre><code>defmodule Storage do
    use Agent
  
    def start_link do
      Agent.start_link(fn -&gt; %{} end, name: :tmp_storage)
    end
  
    def set(key, value) do
      Agent.update(:tmp_storage, fn map -&gt; Map.put_new(map, key, value) end)
    end
  
    def get(key) do
      Agent.get(:tmp_storage, fn map -&gt; Map.get(map, key) end)
    end
  end
  </code></pre>
  
  <p>So I m trying to put this functions to the routes of the web server:</p>
  
  <pre><code>defmodule Storage_router do
    use Plug.Router
    use Plug.Debugger
    require Logger
    plug(Plug.Logger, log: :debug)
    plug(:match)
    plug(:dispatch)
  
    post "/storage/set" do
      with {:ok, _} &lt;- Storage.set(key, value) do
        send_resp(conn, 200, "getting the value")
      else
        _ -&gt;
          send_resp(conn, 404, "nothing")
      end
    end
  end
  </code></pre>
  
  <p>And i recieve:</p>
  
  <p><code>warning: variable "key" does not exist and is being expanded to "key()", please use parentheses to remove the ambiguity or change the variable name
    lib/storage_route.ex:12</code></p>
  
  <p><code>warning: variable "value" does not exist and is being expanded to "value()", please use parentheses to remove the ambiguity or change the variable name
    lib/storage_route.ex:12</code></p>
  
  <p>looking for any suggestions\help </p>