Re: Standard library praise and challenge

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

It should be max_sq(sequence s) and max(atom,atom).

Or even just maxs(sequence s) and max(atom,atom). In line with puts() gets() etc...

Or...

public function max( object a, object b = a ) 
    if atom(a) then 
        if a >= b then 
            return a 
        else 
            return b 
        end if 
    end if 
    b = mathcons:MINF 
    atom c 
    for i = 1 to length(a) do 
        c = max(a[i]) 
        if c > b then 
            b = c 
    end if 
    end for 
    return b 
end function 

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu