Re: replace()ing a crash

new topic     » goto parent     » topic index » view thread      » older message » newer message
Graeme said...

suddenly started exiting without any warning or output.

Can you (or anyone else I suppose) try this:

function replace3(sequence s,object o1,object o2)  
    for x=1 to length(s) do  
        if equal(s[x],o1) then  
            s[x]=o2  
        end if  
    end for  
    return s  
end function  
 
?replace3({"this","that"},"that","other")   -- {"this","other"} 
 
function replace4(sequence s,object o1,object o2)  
    s[o2..o2] = o1 
    return s  
end function  
 
?replace4({"this","that"},"that","other")   -- ??? 

Should that be crashing (on Euphoria) without a proper message/ex.err then it should be looked into (but not by me, sorry).

Note that Phix [not that you use that] needed a minor tweak to builtins/VM/pFixup.e to report the error correctly inside replace4() (many thanks), although it did at least show the failing call to replace4().

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu