From: John M. S. <sk...@oz...> - 2003-02-26 05:15:12
|
> My general philosophy on labels is that they should only be used when > there is a real good reason to use them. What a 'real good reason' is I'm > still working on. Good reason (1) is obvious: there are a LOT of arguments. Good reason (2) might be: there are several arguments of the same type and no natural order the programmer might guess at, or, the chosen order differs from the C function it is wrapping. An example might be: Array.make count value can be confused with Array.make value count without a type error if the array type is int array. Good reason (3) is related to both: there are many arguments and some are optional (so labels are necessary to invoke the defaults). Another less good reason is: there are enough arguments and lack of natural ordering, and the client is likely to want to curry the function with subsets of the arguments, perhaps multiple times. -- John Max Skaller, mailto:sk...@oz... snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 |