ns Elixir::Macros

defmacro unless: [clause, options] do
  positive = Erlang.orddict.fetch(:do, options)
  negative = Erlang.orddict.fetch(:else, options)
  quote(if(unquote(clause), do: unquote(negative), else: unquote(positive)))
end

defmacro &&: [left, right] do
  quote(
    case unquote(left) do
    match: false
      false
    match: nil
      nil
    match: _
      unquote(right)
    end
  )
end

defmacro ||: [left, right] do
  quote(
    case !(__oror_var = unquote(left)) do
    match: false
      __oror_var
    else:
      unquote(right)
    end
  )
end

defmacro !: [expr] do
  quote(
    case unquote(expr) do
    match: false
      true
    match: nil
      true
    else:
      false
    end
  )
end
ns Elixir::Macros

defmacro unless: [clause, options] do
  quote(if(!unquote(clause), unquote(options)))
end

defmacro &&: [left, right] do
  quote(
    case unquote(left) do
    match: false
      false
    match: nil
      nil
    match: _
      unquote(right)
    end
  )
end

defmacro ||: [left, right] do
  quote(
    case !(__oror_var = unquote(left)) do
    match: false
      __oror_var
    else:
      unquote(right)
    end
  )
end

defmacro !: [expr] do
  quote(
    case unquote(expr) do
    match: false
      true
    match: nil
      true
    else:
      false
    end
  )
end
Simplify unless macro now that we have "!"
Simplify unless macro now that we have "!"

kimshrier/elixir,antipax/elixir,michalmuskala/elixir,gfvcastro/elixir,lexmag/elixir,beedub/elixir,kimshrier/elixir,elixir-lang/elixir,ggcampinho/elixir,pedrosnk/elixir,lexmag/elixir,pedrosnk/elixir,gfvcastro/elixir,ggcampinho/elixir,kelvinst/elixir,joshprice/elixir,antipax/elixir,beedub/elixir,kelvinst/elixir