Talk:Forward difference: Difference between revisions

no edit summary
No edit summary
Line 9:
:::Any 'extension' behaviour should be carefully noted if you rely on it which means you should know what this behaviour is, and that you rely on it. In this specific case I think it would be incorrect to produce a forward difference from an input list of one value. It is more correct to signal an error (with a meaningful explanation).
:::If your function was guaranteed to be called in such a way that you would never be called on to produce a forward difference of less than two values then no further checks need be done, but I think its wrong to argue that the forward difference of one value is an empty list just because a particular implementation would generate that - unless you extend ''your'' meaning of forward difference explicitly to handle this. --[[User:Paddy3118|Paddy3118]] 21:53, 27 August 2008 (UTC)
::::Except for those Rosetta Code tasks that specifically involve error-trapping, code solutions should assure that correct results are produced when the program is provided "good" input. Your claim is that input other than a numeric list of at least length two does not count as good. When the input is not good it is irrelevant what the code produces. Error reporting such as you have suggested has nothing to do with the task at hand. --[[User:TBH|TBH]] 18:21, 28 August 2008 (UTC)
 
It is very nice to see the [[Python]] entry. Studying it has improved my grasp of that language. --[[User:TBH|TBH]] 09:45, 11 January 2008 (MST)
Anonymous user