On Saturday, September 13, 2014 03:52:11 PM Jake Bolewski wrote:
> One version of a function could handle all parametric expression types, it 
> would just have to do runtime lookup similar to what you would have to do 
> now,
> so isa(arg, Expr) && (arg::Expr).head === :headB would then just become 
> isa(arg, Expr{:headB}).

But wouldn't a function like

function find_ref_expr(ex::Expr)
    if ex.head == :ref
        # found it!
    else
        for i = 1:length(ex.args)
            find_ref_expr(ex.args[i])
        end
    end
end

end up being specialized for each different type of expression head? I'm not 
saying that specialization would not ever be useful, but I do wonder about the 
cost of compiling 20 different variants when all you care about might be a 
single head type.

Anyway, just thought I'd raise one potential reason to perhaps contemplate 
_not_ making a breaking change. In any case,  it would probably good to try to 
get a sense for what the performance tradeoff would be before tackling such a 
project.

Best,
--Tim

Reply via email to