-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Description
Hi Matt,
Just started using elixir-mode and its great. Thanks you so much for your effort.
btw I'm using elixir-mode 2.2.4 with emacs 24.3.1
I'm working my way through Chris McCord metaprogramming book and this example from chapter 2:
defmodule ControlFlow do
defmacro my_if(expr, do: if_block), do: if(expr, do: if_block, else: nil)
defmacro my_if(expr, do: if_block, else: else_block) do
quote do
case unquote(expr) do
result when result in [false, nil] -> unquote(else_block)
_ -> unquote(if_block)
end
end
end
end
ends up look like this when tabbed:
defmodule ControlFlow do
defmacro my_if(expr, do: if_block), do: if(expr, do: if_block, else: nil)
defmacro my_if(expr, do: if_block, else: else_block) do
quote do
case unquote(expr) do
result when result in [false, nil] -> unquote(else_block)
_ -> unquote(if_block)
end
end
end
end