Skip to content

Instantly share code, notes, and snippets.

@paulcsmith
Created June 7, 2017 20:18
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 paulcsmith/ad68b6c1f22ac42a8bedd37a341d1ae0 to your computer and use it in GitHub Desktop.
Save paulcsmith/ad68b6c1f22ac42a8bedd37a341d1ae0 to your computer and use it in GitHub Desktop.
name = "String"
macro put_class(var)
puts {% typeof(var).stringify %}
end
# why does this work?
p typeof(name) # prints String
# But this can't work because `typeof` doesn't work in a macro?
# put_class(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment