Path: csiph.com!usenet.pasdenom.info!news.etla.org!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: The meaning of xt in Forth-94 Date: Tue, 23 Jun 2015 18:13:39 -0400 Organization: Aioe.org NNTP Server Lines: 75 Message-ID: References: <2e398151-3bb9-4827-8b25-2065117703f1@googlegroups.com> <2015Jun17.123449@mips.complang.tuwien.ac.at> <2015Jun19.140757@mips.complang.tuwien.ac.at> <55840e9b.78522916@news.eternal-september.org> <2015Jun20.173600@mips.complang.tuwien.ac.at> <5586cdf5.258583762@news.eternal-september.org> <2015Jun22.104712@mips.complang.tuwien.ac.at> <558811d4.341494581@news.eternal-september.org> <5--dnXkktt6TkhTInZ2dnUU7-ImdnZ2d@supernews.com> <9bcc663b-1ac7-4bbf-8731-1f6e0e40f37c@googlegroups.com> <15782669-963a-457f-957a-ac045492d54b@googlegroups.com> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.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:40006 On Tue, 23 Jun 2015 06:38:27 -0400, Mark Wills wrote: > The point is simply that the token > should be the "atom" which can be "split" with other words to reveal > other information about the word. > > xt --> link field > xt --> flags > xt --> run-time semantics > xt --> interpretation semantics > xt --> compilation semantics > ... > Furthermore, a method is required to be able to associate the > three types of semantics with a single word. What three types of semantics? I.e., if an XT is just an address which is just an integer, it has no semantics whatsoever. E.g., ' (tick) and FIND return the CFA for my Forth which is also the XT. Which semantics is the CFA? I.e., isn't it all three? E.g., is this what you mean? interpretation: FIND used in inner interpreter and inner compiler ... run-time: ' EXECUTE where ' uses FIND compilation: ' COMPILE, where ' uses FIND How the XT is understood depends on how it is accessed or used, i.e., raw data read at the address, code executed from the CFA or XT, saved as an interpreter token, etc. BTW, I use ' XDUMP in my forth. XDUMP is the longest high-level Forth word I've ever written. It displays all fields in the dictionary entry with nice labels, e.g., LFA, NFA, CFA, PFA etc, and with the data as 32-bit hex or strings. XDUMP is much nicer than just using DUMP . > And therein is the > problem: A *single* word has up to three different behaviours, > but the standard does not fully cover getting/setting and > compiling for those modes. > > How to fix it? > > I like: > > set-comp ( xt1 xt2 -- ) > The compilation semantics of the word identified by xt2 shall be > set to xt1. During compilation, FIND , tick, COMPILE, et al shall > return xt1. > > set-int ( xt1 xt2 -- ) > The interpretation semantics of the word identified by xt2 shall be > set to xt1. During interpretation, FIND , tick et al shall return > xt1. In general, this separation of semantics looks problematic to me. It seems to be an end-run around STATE aware words, which leads to implementation problems since it would seem to require duplicating certain aspects of the dictionary entry. In essence, doesn't it force you to implement two PFAs? I.e., one PFA area is needed for interpretation semantics and another PFA area is needed for compilation semantics, whereas a STATE aware word would have one definition with an IF ELSE THEN. Am I understanding this correctly? You're indicating possible multiple XTs, which could be done too. If a word has multiple XTs, e.g., one for interpretation and another for compilation, where are the PFA areas for all these XTs stored? Is this like a CREATEd word followed by a NONAME word, where the first word controls the PFA areas for both? Rod Pemberton