Sha256: 43fff94e219fcb0a66960f58dd0ee6f9aa94240fed157ae26124a64d004296d1
Contents?: true
Size: 951 Bytes
Versions: 327
Compression:
Stored size: 951 Bytes
Contents
defmodule Forth do @opaque evaluator :: any @doc """ Create a new evaluator. """ @spec new() :: evaluator def new() do end @doc """ Evaluate an input string, updating the evaluator state. """ @spec eval(evaluator, String.t) :: evaluator def eval(ev, s) do end @doc """ Return the current stack as a string with the element on top of the stack being the rightmost element in the string. """ @spec format_stack(evaluator) :: String.t def format_stack(ev) do end defmodule StackUnderflow do defexception [] def message(_), do: "stack underflow" end defmodule InvalidWord do defexception [word: nil] def message(e), do: "invalid word: #{inspect e.word}" end defmodule UnknownWord do defexception [word: nil] def message(e), do: "unknown word: #{inspect e.word}" end defmodule DivisionByZero do defexception [] def message(_), do: "division by zero" end end
Version data entries
327 entries across 327 versions & 1 rubygems