As it happens a PL/I generic statement can distinguish the two sorting schemes in the example you cite very readily. The first has two arguments, the second three, so that, simplistically,
declare generic_sort generic(sort1 when(*,*), sort2 when(*,*,*)) ; does the job at compile time. (It can be done at execution time too, but this is not the place for an explication of how.) I read the comments associated with this sort with some interest. The language it uses is curious, an instance of Quine's mathematosis without much mathematics. For some reason, while it uses one of Knuth's algorithms, it avoids making Knuth's standard distinction between a set of unique keys and a multiset of non-unique ones (one that contains or, better, may contain duplicate keys). The result is labored, in effect obfuscatory. The routine itself is, however, correct. I compiled it (trivially altered for my compiler) and tested it successfully. Your catholic taste in statement-level languages is admirable, much less parochial than mine: I have never been able to include COBOL among the languages I approve. I have, for my sins, had to confront a good deal of it; but close acquaintance has not made me fonder of it. What must be conceded is that the post-CODASYL language is improving. It is useful to have substrings even if one must call them reference modifications. John Gilmore, Ashland, MA 01721 - USA ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
