Passing a string into function as a expression

cool… makes the solution for @ke_xu much more convenient and general

function F(condition::String, object::AType)
    d= @eval object -> $(Meta.parse(condition))
    if Base.invokelatest(d, object)
        Perform()
    end
end
2 Likes