Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: The meaning of xt in Forth-94 Date: Sun, 28 Jun 2015 15:10:29 -0400 Organization: Aioe.org NNTP Server Lines: 52 Message-ID: References: <2e398151-3bb9-4827-8b25-2065117703f1@googlegroups.com> <5--dnXkktt6TkhTInZ2dnUU7-ImdnZ2d@supernews.com> <9bcc663b-1ac7-4bbf-8731-1f6e0e40f37c@googlegroups.com> <15782669-963a-457f-957a-ac045492d54b@googlegroups.com> <6b6d6db2-d73e-4a5d-9936-6f8ebfae9004@googlegroups.com> <2015Jun24.170123@mips.complang.tuwien.ac.at> <0bb265fc-0efd-491b-accd-e1846c9b3566@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:40109 On Wed, 24 Jun 2015 12:54:07 -0400, Raimond Dragomir wrote: > I just tested a lot of combinations. But my system - I admit - has some > differences: > 1. I don't have POSTPONE > 2. I don't have [COMPILE] > 3. I don't have [ and ] - there is no way in my system to turn on and off > the state just like that. It's really ugly and I'm pretty sure this > confuses > a lot of programmers. Me for sure. > 4. I'm also not very sure if my COMPILE and COMPILE, are exactly the same > as the standard ones. > > What I have: > COMPILE > which parses the next word and compiles it. It is for compiling > immediate words. Normal words are compiled directly, and we need a way to > compile immediate words too (otherwise they get executed not compiled) > > COMPILE, > which is a normal word. It expects an xt on the stack, and compiles it > but when the word where it is compiled is executed. With COMPILE, we can > write words that are able to compile something on their turn. > > EVAL_XT > This word, and an entire familiy of words like it with constant folding > functionality, is a state smart word. It does COMPILE, in compiling mode > and EXECUTE in interpretation mode. > If you have a threaded, interpreted Forth, then COMPILE, is just , (comma). : COMPILE, , ; : [COMPILE] ' , ; immediate POSTPONE is usually built with COMPILE and COMPILE, or , (comma) with the beginning similar to ' (tick). See this post of mine from a few years ago where I repeat a bunch of the c.l.f. definitions for POSTPONE over the years. You may need to scroll down a bit: https://groups.google.com/forum/#!msg/comp.lang.forth/RqN6h4qNlPs/RrktBeS62cUJ So, now, you should just be missing [ and ] hopefully. Rod Pemberton -- Tolerance and socialism attracts intolerance and terrorism. See: France, United Kingdom, Germany, Denmark, Belgium, Netherlands, ...