Talk:Symmetric difference: Difference between revisions

→‎Set type: Consensus ???
(→‎Set type: Consensus ???)
Line 61:
:::::''If input types are being substituted then is it obvious that any input lists should/should not have duplicates and should/should not have an order imposed for the algorithm to work? ''
:::::Obvious or not, the concern can be resolved by simply noting the caveat in each language's example area, rather than requiring that a workaround be demonstrated in code. --[[User:Short Circuit|Michael Mol]] 13:44, 10 February 2010 (UTC)
 
::::::Yes, a note in each example using lists for input would work too. --[[User:Paddy3118|Paddy3118]] 16:58, 10 February 2010 (UTC)
 
:: Paddy3118 wrote:<br />
Line 71 ⟶ 73:
 
::Furthermore, you can define a function to return the symmetric difference of two sets if two sets are provided as input, or to throw an exception if lists are provided (containing one or more duplicates). This is a different definition of the function, and it's definition includes lists containing duplicate elements as valid inputs to the functon. Just that it's response is different than if two valid sets were provided as inputs.--[[User:Rldrenth|Rldrenth]] 16:43, 10 February 2010 (UTC)
 
:::Hi Rldrenth, ''"...then it is an error to call the function with a list containing duplicate elmeents."''. I would go further. An example should state how and why their algorithms can use lists instead of sets; or constrain arbitrary lists as part of their routine. --[[User:Paddy3118|Paddy3118]] 16:58, 10 February 2010 (UTC)
Anonymous user