Re: Standard library praise and challenge

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

I would expect max/min to apply to top-level elements only.

So...

max( { "Head", "Tail" } ) -- "Tail" since it is higher alphabetically 
max( { 1, 2, 3 } ) -- 3 
max( {} ) -- Error condition 
max( { {1}, {2} } ) -- {2} 
max( { {1,{1}}, {1,{2}} } ) -- {1,{2}} 
max( { 1, {1} } ) -- 1? now we're getting somewhere :) 

To search deep like the current max() does for the largest atom can be useful but seems to be counter-intuitive. Maybe a max_deep() or something should do this instead so max() can get back its common intent.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu