The Expr method had an error and would overwrite the expressions in its 
argument. Here's a better version.

function biggen(x::Expr)
    Meta.isexpr(x, :call) || error("Only works for calls right now")
    y = copy(x);
    for i in 2:length(y.args)
        y.args[i] = biggen(x.args[i])
    end
    return y
end

(sorry about the repost... I'm going to give myself an email timeout right 
now.)

On Friday, September 19, 2014 9:57:00 AM UTC-5, Gray Calhoun wrote:
>
>
>
> On Friday, September 19, 2014 9:32:09 AM UTC-5, David P. Sanders wrote:
>>
>> El viernes, 19 de septiembre de 2014 09:26:09 UTC-5, David P. Sanders 
>> escribió:
>>>
>>> El viernes, 19 de septiembre de 2014 08:58:56 UTC-5, Isaiah escribió:
>>>>
>>>> To do what you want, very briefly:
>>>>
>>>> > x.args[3] == :pi && x.args[3] = Expr(:call, :BigFloat, :pi)
>>>> ...
>>>>
>>> Yes, that's what I need, thanks. Now I need to iterate over the (in 
>>> principle arbitrarily complex, i.e. nested) syntax tree and do this 
>>> everywhere. 
>>> Is there a standard method for this kind of iteration?
>>>
>>
>> I guess some kind of recursion. I'll give it a go...
>>
>
> This might help you get started:
>
> biggen(x::Symbol) = Expr(:call, :big, x)
> [...cut...]
>
 
 

Reply via email to