Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Reduce dictionary lookups using LIT ? Date: Tue, 01 Jul 2014 20:24:36 -0400 Organization: Aioe.org NNTP Server Lines: 46 Message-ID: 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:32106 Reduce dictionary lookups using LIT ? ... I saw a quote from a Forth book which said LIT was also useful to eliminate dictionary lookups of numbers when loading and compiling a vocabulary. So, instead of: : ONE 1 ; \ LIT compiled by innner interpreter this would be used in a vocabulary: : ONE LIT 1 ; \ LIT explicitly used Here, 1 is not searched for in the dictionary by the inner interpreter when compiling ONE due to the use of LIT . I'd like to use that syntax in my vocabulary, but I think it creates some problems. I already have a historically based run-time LIT which works differently. A new "high-level" LIT as used in ": ONE LIT 1 ;" would need to be something like the following: : LIT BL WORD NUMBER POSTPONE LITERAL ; IMMEDIATE Except, LITERAL calls the original run-time LIT: : LITERAL POSTPONE LIT , ; IMMEDIATE : LIT R> DUP "cell_adjustment" >R @ ; This creates a name conflict between the two LITs, since my vocabulary would need to use both at the same time. A common option in such naming conflict situations is to rename the run-time, wrapping it in paren's, e.g.: (LIT) . Except, I don't want to change the historical name of the original run-time LIT . It seems to be well accepted. So, is there a common name for such a high-level LIT? Or, was there a version of LIT that did both? And, is this technique even used anymore? Rod Pemberton