Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Just an idea : B-tree on-disk storage of FORTH dictrionary words for fast indexing and search Date: Fri, 17 Oct 2014 21:33:30 -0400 Organization: Aioe.org NNTP Server Lines: 70 Message-ID: References: <0a242e60-65db-4e17-a98b-e797d5b35905@googlegroups.com> <0e6dna-zwvcdVKfJnZ2dnUU7-U-dnZ2d@supernews.com> <9sCdnTcocuD0093JnZ2dnUU7-L2dnZ2d@supernews.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:33992 On Fri, 17 Oct 2014 20:39:51 -0400, Elizabeth D. Rather wrote: > On 10/17/14 2:30 PM, Rod Pemberton wrote: >> On Fri, 17 Oct 2014 04:58:20 -0400, Andrew Haley >> wrote: >>> Elizabeth D. Rather wrote: >>>> On 10/16/14 11:55 AM, Rod Pemberton wrote: >>>>> On Sun, 12 Oct 2014 14:33:37 -0400, Elizabeth D. Rather >>>>> wrote: >>>>>> The requirement (from Forth 2000X) is "When searching a word list >>>>>> for >>>>>> a definition name, the system shall search each word list from its >>>>>> last definition to its first." There is no restriction on how the >>>>>> dictionary is organized or searched, providing that the most recent >>>>>> definition of a word will be found in preference to any prior >>>>>> definition that may exist in the current search order. >>>>> >>>>> Unfortunately, requiring that the most recent definition of a word >>>>> to be >>>>> found requires that the order of *all* other words be preserved in >>>>> time >>>>> order they were defined. >>>> >>>> That is correct. However, 40 years of use has found this not in the >>>> least "unfortunate" but rather an asset that most users depend upon. >>> >>> Actually not: it only requires that identically-named words be >>> preserved in the order they were defined. Otherwise, hashed >>> dictionaries could not work. >>> >> >> Are you saying it's valid to change this defining order? >> >> : TODO 1 . ; >> : FIXME TODO ; >> : HELP1 FIXME ; >> : TODO 2 . ; >> : FIXME TODO ; >> : HELP2 FIXME ; >> >> E.g., to this order? >> >> : TODO 1 . ; >> : TODO 2 . ; >> : FIXME TODO ; >> : FIXME TODO ; >> : HELP1 FIXME ; >> : HELP2 FIXME ; >> >> That has the identically-named words preserved in the order >> they were defined, which is what you just stated. Clearly, >> this doesn't and wouldn't ever work correctly. > > Yes, but you're trying to reference them before they've been > compiled at all. Nobody ever said that would work. The entire point was that they must be compiled in a certain order to preserve their relationships. Are you saying that _after_ the words have been compiled, then the dictionary is reorganized and/or sorted? What's the point in that? Each definition consumes space. Sorting wastes time. The best option would be to leave them where they are in the linked-list and provide an additional layer of indexing. Of course, there needs to be a point in time when that operation is cost-effective. You're not going to do that over and over again or continuously. So, you'd do it for the system dictionary, but not for user apps. Rod Pemberton