Skip to content

Instantly share code, notes, and snippets.

@robmckinnon
Last active April 10, 2016 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robmckinnon/d4fb106d8bd03d093ff4ef63151b7aa9 to your computer and use it in GitHub Desktop.
Save robmckinnon/d4fb106d8bd03d093ff4ef63151b7aa9 to your computer and use it in GitHub Desktop.
Elixir sandbox
quote do: String.downcase("THIS")
# {{:., [], [{:__aliases__, [alias: false], [:String]}, :downcase]}, [], ["THIS"]}
quote do: String.downcase("THIS") |> inspect
# {:|>, [context: Elixir, import: Kernel],
# [{{:., [], [{:__aliases__, [alias: false], [:String]}, :downcase]}, [],
# ["THIS"]}, {:inspect, [], Elixir}]}
(quote do: String.downcase("THIS")) |> inspect
# "{{:., [], [{:__aliases__, [alias: false], [:String]}, :downcase]}, [], [\"THIS\"]}"
(quote do: String.downcase("THIS")) |> inspect |> String.replace(~r({|}), "")
# ":., [], [:__aliases__, [alias: false], [:String], :downcase], [], [\"THIS\"]"
# mix.exs:
#
# ...
# defp deps do
# [
# {:expand, ">= 0.0.3"}
# ]
# end
# ...
# iex -S mix
IO.puts Expand.it quote do: String.downcase("X")
# {
# {
# :.,
# [
# {
# :__aliases__,
# [
# alias:
# false
# ],
# [
# :String
# ]
# },
# :downcase
# ]
# },
# '',
# [
# "X"
# ]
# }
# :ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment