Talk:Forward difference: Difference between revisions
Content added Content deleted
No edit summary |
(Older version of J solution should be retained, along with the new solution.) |
||
Line 4: | Line 4: | ||
:::Yes, that's the way to handle receiving an empty list. (A similar "corner case" has been discussed [[Talk:Maximum_subarray|here]].) <br>One of the things I appreciate about [[J]] is how many of these exception-situations have been resolved within the language itself. In this instance both the single-element and empty-list possibilities require no specific code. --[[User:TBH|TBH]] 09:45, 11 January 2008 (MST) |
:::Yes, that's the way to handle receiving an empty list. (A similar "corner case" has been discussed [[Talk:Maximum_subarray|here]].) <br>One of the things I appreciate about [[J]] is how many of these exception-situations have been resolved within the language itself. In this instance both the single-element and empty-list possibilities require no specific code. --[[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) |
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) |
||
With regard to the replacement of ((}. - }:) ^:) by (2&(-/\)): |
|||
I agree that a solution in the form of a verb is somewhat better than a solution that is an adverb, although the benefits strike me as subtle and minor. |
|||
I think the original solution is worth retaining as an example because of its form. It is not only a different algorithm, it is another strong example of how tacit form allows one to "code the concept." These two solutions complement one another, so both should be included. |
|||
Contrary to the comment upon replacement, the new program is not shorter than the first solution. This is demonstrated by the following J interaction: |
|||
#;:'(}. - }:) ^:' |
|||
6 |
|||
#;:'2&(-/\)' |
|||
7 |
|||
--[[User:TBH|TBH]] 21:13, 20 August 2008 (UTC) |