While trying to learn Crystal I keep printing the type of variables for which I write p typeof(x)
.
Is there a shorter way to do it?
I created a macro for this:
macro t(name)
print "%s %s\n" % {typeof({{name}}), {{name}}}
end
Is it possible to tell Crystal to load this macro for every Crystal program?
Basically to require a file without any require
statement? Sort of like .bashrc for the shell?