Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Paul E Bennett Newsgroups: comp.lang.forth Subject: Re: Does Forth solve the paradox? Date: Sun, 16 Nov 2014 00:45:11 +0000 Organization: Hidecs Consultancy Lines: 59 Message-ID: References: <6f36e5e5-037c-41e2-89c5-2bc11937ddcd@googlegroups.com> <5eKdnVY0PdQQf_jJnZ2dnUVZ8sKdnZ2d@supernews.com> <2014Nov15.172155@mips.complang.tuwien.ac.at> <5467ea7a$0$6851$e4fe514c@dreader36.news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: individual.net FEgUpd+AiUwUEXDWAYH+JA0spoPl47gPpTukI8SPLw3Q7sc9e5 Cancel-Lock: sha1:8cG6nQzgYyDRtMGPzs6DUlRdWa4= User-Agent: KNode/4.11.4 Xref: csiph.com comp.lang.forth:34429 Albert van der Horst wrote: > In article <2014Nov15.172155@mips.complang.tuwien.ac.at>, > Anton Ertl wrote: >>Andrew Haley writes: >>> A good counter example is sorting: there >>>is no general-purpose sorting algorithm which is the best for all >>>datasets and all systems. >> >>Best? That sounds like "tightly optimized for a specific application >>szenario", which I mentioned earlier. Otherwise, mergesort and >>quicksort are pretty good algorithms, and either one will do nicely >>for most of the few applications that need sorting. In the last 25 >>years, I did nearly all of my sorting with the Unix sort program; I >>needed sorting in a program written in something lower-level than a >>shell-script only once (and there I used standard C's qsort() >>function). > > I had the problem of sorting a glossary, first by chapter then by > wordname. This I had solved by a c++ program (my first actually: 1994). > It specifies records and fields by regular expressions. > This was because I didn't know how to solve that sorting problem in some > other way. This general purpose full featured 10 kg sledgehammer has > served me nicely, and I recently made it to compile again to a 64 bit > version, after using the unaltered program till my 90 MHz Pentium broke > down. It is instrumental in generating the ciforth documentation. > > At the time,it came out first in a comparative test I did, in > reliability, features and even in speed. > > Bottom line, a situation where you want to sort integers in a > straight array is rare. You can handle fixed records with an > execution token for the comparison , and that is a one screener. > But if you're encountering a somewhat hard practical situation > that probably doesn't cut it. > > And as you point out, mostly you sort files anyway. > The unix sort has some heavy usage with me on all kind of euler problems, > to analyse tables of results for patterns. > >> >>- anton > > Groetjes Albert One interesting aspect for sorting the Dictionary that was presented at one of the EuroForth's was to add another linkage into the header that could contain the sequence number for its sorted order. Only this field got sorted and the rest of the body stayed put. Seemed quite a neat solution, especially if you wanted an alphabetically ordered dictionary listing. -- ******************************************************************** Paul E. Bennett IEng MIET..... Forth based HIDECS Consultancy............. Mob: +44 (0)7811-639972 Tel: +44 (0)1235-510979 Going Forth Safely ..... EBA. www.electric-boat-association.org.uk.. ********************************************************************