using DataFrames
using Dates
using RuntimeGeneratedFunctions
RuntimeGeneratedFunctions.init(@__MODULE__)
w = Base.get_world_counter()
function Base.show(io::IO, mime::MIME"text/plain", df::AbstractDataFrame; kwargs...)
fn = @RuntimeGeneratedFunction(:(
(v, i::Int, j::Int) -> begin
println(mime) # <- This fails
typeof(v) <: DateTime ? Dates.format(v, "dd-mm-yyyy HH:MM") : v
end
))
Base.invoke_in_world(w, Base.show,
io,
mime,
df;
formatters=fn,
kwargs...
)
end
The result of the code above is:
UndefVarError: mime not defined
Am i doing something wrong?