Re: Missing in misc.e
- Posted by ChrisBurch2 <crylex at fre?uk.co?uk> Jul 20, 2007
- 704 views
CChris wrote: > > Jason Gade wrote: > > > > Juergen Luethje wrote: > > > Not for me. > > > Also, of course finding the smallest element of a list is the general > > > principle, and finding the smallest of 2 given values is a special case. > > > This means: > > > a) A special function > > > x = mini2(a,b) > > > is not necessary, because always the general function can be used > > > instead: > > > x = min({a,b}) > > > > If this works, then you wouldn't need two different functions, would you? > > That > > seems pretty elegant to me. (Note: I haven't tried to implement it). > > > > Not elegant, as the curly braces are not needed. > Confusing, because the min() notation to compare two objects is so universal. > > If we could overload symbols, ie having different routines share the same name Don't you dare! ( ) Chris > with different signatures, because they do the same thing to different sorts > or forms of arguments, then both might be called min() or max() for more > convenience. > But I doubt this will be ever possible in Eu because it is weakly typed. > > CChris > > > > > -- > > "Any programming problem can be solved by adding a level of indirection." > > --anonymous > > "Any performance problem can be solved by removing a level of indirection." > > --M. Haertel > > "Premature optimization is the root of all evil in programming." > > --C.A.R. Hoare > > j.