metaprogramming


Transform quoted elixir code to a code string


I have a situation where I am expecting some quoted elixir code to be an atom. If the wrong quoted code is passed in I want to raise an error and show what the wrong code was.
Simplest way to show what I need is with an example.
quoted_code = quote do: %{}
"%{}" = some_func(quoted_code)
You can achieve this with Macro.to_string/2
Macro.to_string(quote do: %{}) #=> "%{}"

Related Links

Using Roslyn, if I have an IdentifierNameSyntax, can I find the member type it refers to (field, property, method…)
Elixir - Define functions in module by metaprogramming
Disambiguate the various quoting mechanisms in Julia metaprogramming
How to initialize list using macros and then generate same set of functions in 2 different modules?
Type-safe metaprogramming? Using strings to query ceylon.language for meta information?
Interpolating an Expression into an Expression
Loop unrolling? in Julia with metaprogramming
Macro for a function template: escaping issues
Macro that defines macro returning struct constant
Array of Expressions to an Array Definition
Code generation from restricted set of input
System of equations using metaprogramming
How to define a partial copy constructor metaprogramically in Julia?
How to interpolate into a Julia “for” expression?
Sending a keyword list to a macro and using bind_quoted
Runtime meta programming in ceylon

Categories

HOME
azure-stream-analytics
time-complexity
formal-languages
angular2-material
battery
package
requirements
shiro
r-googlesheets
javacc
drop-down-menu
octave
github-enterprise
nancy
qsqlquery
alpacajs
null-pointer
mapstruct
solrcloud
simpleitk
symbols
microsoft-ocr
breadth-first-search
qliksense
interpreter
beta
maze
amazon-quicksight
user-defined-functions
jaws
realm-mobile-platform
calculation
mustache
laravel-eloquent
html-encode
jwplayer6
servicestack-text
video-capture
openproject
sessionstorage
amazon-ses
metawidget
cin
c9.io
kill
oracle-service-bus
jide
convex-optimization
scalding
oracleclient
headless
sundials
cmp
android-instrumentation
cudd
cubism.js
parfor
qtplugin
dotnetnuke-7
scaffolding
dimension
observablecollection
mediametadataretriever
lua-telegram-bot
upx
dynamics-nav-2016
atoi
ansi
teamcity-9.1
ms-access-2000
code-documentation
browserify-shim
cbind
angular-carousel
ray
vsx
fpdi
printdialog
node-blade
dolby-audio-api
android-loadermanager
mkv
objectquery
josql
entity-attribute-value
expression-blend-4
catransform3d
massive
socketserver
photolibrary
instantiationexception
django-piston
int64

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App