metaprogramming - Transform quoted elixir code to a code string -


i have situation expecting quoted elixir code atom. if wrong quoted code passed in want raise error , show wrong code was.

simplest way show need example.

quoted_code = quote do: %{} "%{}" = some_func(quoted_code) 

you can achieve macro.to_string/2

macro.to_string(quote do: %{}) #=> "%{}" 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -