Optional parameters: Difference between revisions

no edit summary
(Revise the header matter to be a bit clearer)
No edit summary
Line 2:
 
Define a function/method/subroutine which sorts a sequence ("table") of sequences ("rows") of strings ("cells"), by one of the strings. Besides the input to be sorted, it shall have the following optional parameters:
:{|
:<table>
|
<tr><td>
----
; ordering
Line 12:
: Reverses the ordering.
----
|}
:</table>
 
This task should be considered to include both positional and named optional parameters, as well as overloading on argument count as in Java or selector name as in Smalltalk, or, in the extreme, using different function names. Provide these variations of sorting '''in whatever way is most natural to your language'''. If the language supports both methods naturally, you are encouraged to describe both.
Anonymous user