groovy/*.class
.crystal
es6/build
+elixir/_build
+elixir/deps
+elixir/erl_crash.dump
+elixir/*.ez
+
# Settings
#
-IMPLS = awk bash c clojure coffee cpp crystal cs erlang es6 factor forth fsharp go groovy \
+IMPLS = awk bash c clojure coffee cpp crystal cs erlang elixir es6 factor forth fsharp go groovy \
haskell java julia js lua make mal ocaml matlab miniMAL nim \
perl php ps python r racket rpython ruby rust scala swift vb guile
cpp_STEP_TO_PROG = cpp/$($(1))
crystal_STEP_TO_PROG = crystal/$($(1))
cs_STEP_TO_PROG = cs/$($(1)).exe
+elixir_STEP_TO_PROG = elixir/lib/mix/tasks/$($(1)).ex
erlang_STEP_TO_PROG = erlang/$($(1))
es6_STEP_TO_PROG = es6/build/$($(1)).js
factor_STEP_TO_PROG = factor/src/$($(1))/$($(1)).factor
cpp_RUNSTEP = ../$(2) $(3)
crystal_RUNSTEP = ../$(2) $(3)
cs_RUNSTEP = mono ../$(2) --raw $(3)
+elixir_RUNSTEP = mix $($(1))
erlang_RUNSTEP = ../$(2) $(3)
es6_RUNSTEP = node ../$(2) $(3)
factor_RUNSTEP = factor ../$(2) $(3)
--- /dev/null
+# This file is responsible for configuring your application
+# and its dependencies with the aid of the Mix.Config module.
+use Mix.Config
+
+# This configuration is loaded before any dependency and is restricted
+# to this project. If another project depends on this project, this
+# file won't be loaded nor affect the parent project. For this reason,
+# if you want to provide default values for your application for third-
+# party users, it should be done in your mix.exs file.
+
+# Sample configuration:
+#
+# config :logger, :console,
+# level: :info,
+# format: "$date $time [$level] $metadata$message\n",
+# metadata: [:user_id]
+
+# It is also possible to import configuration files, relative to this
+# directory. For example, you can emulate configuration per environment
+# by uncommenting the line below and defining dev.exs, test.exs and such.
+# Configuration from the imported file will override the ones defined
+# here (which is why it is important to import them last).
+#
+# import_config "#{Mix.env}.exs"
--- /dev/null
+defmodule Mal do
+end
--- /dev/null
+defmodule Mix.Tasks.Step0Repl do
+ def run(_), do: main
+
+ def main do
+ IO.write(:stdio, "user> ")
+ IO.read(:stdio, :line)
+ |> handle_line
+
+ main
+ end
+
+ defp handle_line(:eof), do: exit(0)
+ defp handle_line(line) do
+ IO.write(:stdio, read_eval_print(line))
+ end
+
+ def read(input) do
+ input
+ end
+
+ def eval(input) do
+ input
+ end
+
+ def print(input) do
+ input
+ end
+
+ def read_eval_print(line) do
+ read(line)
+ |> eval
+ |> print
+ end
+end
--- /dev/null
+defmodule Mal.Mixfile do
+ use Mix.Project
+
+ def project do
+ [app: :mal,
+ version: "0.0.1",
+ elixir: "~> 1.0",
+ build_embedded: Mix.env == :prod,
+ start_permanent: Mix.env == :prod,
+ deps: deps]
+ end
+
+ # Configuration for the OTP application
+ #
+ # Type `mix help compile.app` for more information
+ def application do
+ [applications: [:logger]]
+ end
+
+ # Dependencies can be Hex packages:
+ #
+ # {:mydep, "~> 0.3.0"}
+ #
+ # Or git/path repositories:
+ #
+ # {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
+ #
+ # Type `mix help deps` for more examples and options
+ defp deps do
+ []
+ end
+end
--- /dev/null
+defmodule Step0Repl do
+ def main do
+ IO.write(:stdio, "user> ")
+ IO.read(:stdio, :line)
+ |> handle_line
+
+ main
+ end
+
+ defp handle_line(:eof), do: exit(0)
+ defp handle_line(line) do
+ IO.write(:stdio, read_eval_print(line))
+ end
+
+ def read(input) do
+ input
+ end
+
+ def eval(input) do
+ input
+ end
+
+ def print(input) do
+ input
+ end
+
+ def read_eval_print(line) do
+ read(line)
+ |> eval
+ |> print
+ end
+end
+
+Step0Repl.main