Skip to content

Instantly share code, notes, and snippets.

@asaaki
Last active August 29, 2015 14:22
Show Gist options
  • Save asaaki/32c310f2f23d3eb4696a to your computer and use it in GitHub Desktop.
Save asaaki/32c310f2f23d3eb4696a to your computer and use it in GitHub Desktop.
defmodule SigilZ do
defmacro sigil_z(input, flags) do
quote do
[input: unquote(input), flags: unquote(flags)]
end
end
end
# then:
import SigilZ
~z(my input data)abc
#=> [input: "my input data", flags: 'abc']
# NB! The flags are a char_list, not a string/binary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment