Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.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: Wed, 24 Jun 2015 20:07:05 -0400 Organization: Aioe.org NNTP Server Lines: 64 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> <2738c663-13f1-4970-b39f-771b0d83644b@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:40040 On Wed, 24 Jun 2015 04:44:42 -0400, Mark Wills wrote: > On Tuesday, 23 June 2015 23:13:28 UTC+1, Rod Pemberton wrote: >> What three types of semantics? I.e., if an XT is just an address >> which is just an integer, it has no semantics whatsoever. > > * Interpretation semantics: What the interpreter should do when > it encounters a word; > * Compilation semantics: What the compiler should do when it > encounters a word; > * Execution semantics: What the word *itself* should do when it > is executed. > > Or at least, that's how I resolve them in my head. [1] > > Example: > > : bar ( -- 1 2 3 ) 1 2 3 ; > : foo ( -- 1 2 3 ) > state @ if > bar > else > true abort" Not in interpretation state, you don't!" > then ; > > Looking at bar: > Execution semantics: push 1 2 & 3 to the stack > Interpretation semantics: same as execution semantics > Compilation semantics: None > > > Looking at foo: > Interpretation semantics: Issue an error and abort > Compilation semantics: Compile a reference to bar > Execution semantics: none - it never gets compiled into a > definition, unlike, say, drop or SWAP, unless you explicitly > compile it, and then you're in state-smart hell. If you do > compile it, you'll most likely get the interpretation > semantics, which is an abort, unless state is non-zero for > some reason. There's no way to explicitly get the compilation > semantics via ' or ['] or find, because they are embedded in > the state-smart code. > > [1] IMO the Forth 200x standard is unhelpful in defining the > meaning of the semantics. > The compilation semantics of foo are automatically available in compilation mode, via STATE where implemented, or from interpreted mode via ] (rbrac). So, why would you need the compilation semantics of foo if not in compilation mode? ... Where would you use this? I.e., the delineation of these modes as implemented for classic Forth interpreters seems to be adequate. It's entirely possible I might've used something like that somewhere but didn't grasp this aspect of it, e.g., COMPILE or [COMPILE] or POSTPONE etc. Rod Pemberton -- It's time to put an end to gun violence! Use a hammer ...