Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Rod Pemberton Newsgroups: comp.lang.forth Subject: Re: TO implementation Date: Thu, 19 Jan 2017 20:49:49 -0500 Organization: Aioe.org NNTP Server Lines: 33 Message-ID: <20170119204949.1f41c0ee@_> References: <9ec202ed-8f32-4b76-b1a2-3cfaafbed507@googlegroups.com> <2017Jan7.150224@mips.complang.tuwien.ac.at> <2017Jan8.162730@mips.complang.tuwien.ac.at> <2017Jan9.192014@mips.complang.tuwien.ac.at> <2017Jan15.161523@mips.complang.tuwien.ac.at> <20170115221901.6a57e261@_> <2017Jan19.122645@mips.complang.tuwien.ac.at> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Newsreader: Claws Mail 3.13.1 (GTK+ 2.24.13; x86_64-unknown-linux-gnu) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:54192 On Thu, 19 Jan 2017 11:26:45 GMT anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote: > So, it may work for VFX or it may not work for some cases even there, > but it does not say anything about the necessity of STATE for > implementing SYNONYM. E.g., here is the current implementation of > SYNONYM on Gforth: > > : Synonym ( "name" "oldname" -- ) \ Forth200x > Header ['] on vtcopy > parse-name find-name dup A, > dup compile-only? IF compile-only THEN name>int lastcfa ! > ['] s>int set->int ['] s>comp set->comp ['] s-to set-to reveal ; > > Look, Rod, no STATE. > That is clearly free of explicit use of STATE, but not necessarily independent of indirect use of STATE via another Forth word executed from SYNONYM, e.g., perhaps via set->comp. STATE is core and must be set during compilation. Is STATE being set during compilation here? STATE is core and should be. Gforth would need to set STATE somewhere during execution of SYNONYM, either directly or indirectly, to be in compliance. If STATE is being set for compilation, then SYNONYM is not independent of STATE and usage of STATE is just being hidden by behind another Forth word. If I display STATE after each and every word in SYNONYM, will I see the value of STATE change? If not, does STATE's value change at some point during the execution of SYNONYM? If not, why not? Rod Pemberton