Skip to content

Instantly share code, notes, and snippets.

@mururu mururu/example.md
Last active Dec 24, 2015

Embed
What would you like to do?
sigil for erlang-mruby
iex(1)> import SigilMruby
nil
iex(2)> %m( [1,2,3].map do |i|         
...(2)>   i + 1                        
...(2)> end) |> Enum.each(&IO.inspect/1)
2
3
4
:ok
iex(3)> %m| %w{ a b c }.join ||> IO.puts
abc
:ok
defmodule SigilMruby do
defmacro sigil_m({ :<<>>, _line, [string] }, []) when is_binary(string) do
:mruby.eval(string)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.