Is there a macro somewhere to treat all enclosed integer-literals as e.g. Int8
instead of Int
? I know I've seen something like it before, but quick googling isn't turning anything up.
See SwapLiterals.jl (a "subdir package" of SafeREPL.jl).
Thanks!
Wow.
If you want something really simple it should be enough to do
nice(x) = x
nice(n::Number) = NiceNumber(n)
nice(ex::Expr) = Expr(ex.head, map(nice, ex.args)...)
macro nice(code)
return esc(nice(code))
end
Last updated: Nov 06 2024 at 04:40 UTC