Talk:TPK algorithm

message: What amazes me is that not only the algorithm itself is sensitive to math domain errors, but that none of the implementations I've seen given seem to do anything about it. (For very large positive values one could solve f(t)==400, yielding for t around 4.3, and write 'TOO LARGE' before ever evaluating f(t).)  bsod 18:44, 1 June 2006 (UTC)
thread_title: Domain errors

message: The algorithm states you MUST supply a user defined function for the main loop of the
function to call.  What the algorithm wants people to do is to provide a brief snippet
of code that shows how one does the things in the algorithm using a particular language.  Myself, I'ld say the algorithm's developers intended that an exception be thrown when the result is out of bounds, and in the main loop the exception is caught (where this capability exists in the language).
I modified the Python and Ruby examples accordingly. I don't know Perl (and if I did, wouldn't admit to it). From all the examples on the web, it seems like Perl mongers don't use functions, preferring instead write everything as an inline script. Unable to modify the example, I removed it. --64.238.49.65 (talk) 02:14, 31 January 2008 (UTC)
thread_title: Errors in examples

message: I reformatted the ALGOL code to make it more readable. In particular, it wasn't obvious where the f() procedure ends and the statements in the outer begin/end block begin. I'm not an Algol expert, so if I got any of it wrong, please feel free to correct it. — Loadmaster 17:51, 15 May 2007 (UTC)
thread_title: ALGOL source code

message: Would is be possible to post the original implementations by Trabb et al verbatim?  Doing so would help clarify the intent of the authors.  Is it to compare the syntax of various languages for demonstrational purposes?  To achieve the goal in as little code as possible, golf-style?  The original implementations might set better direction from the originators. Maerics 04:44, 27 June 2007 (UTC)
thread_title: Original Implementations for Direction

message: The current article has implementations in pseudocode, ALGOL 60, Perl, Python, and Ruby, and I just removed one in Smalltalk. We should have at most three implementations here, and perhaps fewer. (See this old WPPL talk thread.) It looks to me like the Python and Ruby examples are basically equivalent, but I'm not fluent in either language, so it's hard to tell whether the Ruby one might be showing something interesting about blocks.
Ideally, we would have the algorithm in pseudocode, plus the original implementation in ALGOL 60 (not reformatted or changed in any way), maybe plus one or two in modern languages if they illustrate useful features that are common in modern languages but aren't already present in the ALGOL 60 example.
Any takers for a restructuring of the example implementations? (If you change the current languages, remember to use the Articles with example code categories appropriately, and don't make up new subcategories.) --Quuxplusone 21:06, 21 October 2007 (UTC)
replies: text: I simply removed all the examples except for the one in ALGOL. I consider all of the rest OR, and I suggest that only properly sourced examples are added in the future. QVVERTYVS (hm?) 11:05, 6 February 2014 (UTC)
thread_title:  Needs fewer implementations 

message: The C++ example uses a very loose layout, and additionally comments, even repetitive.
That makes it very unintuitive to compare with the other examples - which is the main point;
Those even use overly compact layout. The purpose is not to compare standard language style guides, but code. 
So I'll make the C++ example compact too. - Volker Siegel (talk) 22:39, 15 June 2016 (UTC)
thread_title:  The extreme difference in layout of the examples is irritating