Talk:Forward difference: Difference between revisions

Content added Content deleted
(→‎J: verb vs adverb: Nice explanation, Dan.)
Line 7: Line 7:
:The formula given '''Bn = An+1 - An''' only applies to lists of two or more elements. It could be argued that it is more correct to signal an error condition when given a list of less than two elements to work on.--[[User:Paddy3118|Paddy3118]] 04:42, 27 August 2008 (UTC)
:The formula given '''Bn = An+1 - An''' only applies to lists of two or more elements. It could be argued that it is more correct to signal an error condition when given a list of less than two elements to work on.--[[User:Paddy3118|Paddy3118]] 04:42, 27 August 2008 (UTC)
::There are differences of opinion as to how best to handle input that does not lie within the domain of a function. My inclination is to (1) rely entirely on the error-reporting facilities of the programming environment, when possible, and (2) use a separate function to assure conformance of the input with the function, when necessary. In the case of forward difference we should also consider whether there is specific value to avoiding the definitional extensions that allow these functions to succeed when provided single-valued or empty lists. In the absence of a larger problem context I cannot see any benefit from producing error conditions instead of empty lists. --[[User:TBH|TBH]] 18:50, 27 August 2008 (UTC)
::There are differences of opinion as to how best to handle input that does not lie within the domain of a function. My inclination is to (1) rely entirely on the error-reporting facilities of the programming environment, when possible, and (2) use a separate function to assure conformance of the input with the function, when necessary. In the case of forward difference we should also consider whether there is specific value to avoiding the definitional extensions that allow these functions to succeed when provided single-valued or empty lists. In the absence of a larger problem context I cannot see any benefit from producing error conditions instead of empty lists. --[[User:TBH|TBH]] 18:50, 27 August 2008 (UTC)
:::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)


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)
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)