Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: quick review of References: NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; 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:27990 On Mon, 20 Jan 2014 17:07:17 -0500, Elizabeth D Rather wrote: > On 1/20/2014 11:14 AM, Rod Pemberton wrote: >> On Mon, 20 Jan 2014 01:54:25 -0500, Elizabeth D Rather >> wrote: >>> On 1/19/2014 7:27 PM, Rod Pemberton wrote: >> Let me break down what I'm doing currently. >> It's been a while since I've read/coded the code, >> so hopefully, no misunderstandings/mistakes posted... >> This is what :NONAME CREATE : and ; are doing: >> >> :NONAME >> -the next few steps creates a dictionary header >> --blanks name field area (NFA) >> --updates link field address (LFA) with LAST >> --updates dictionary bits (part of NFA) >> --updates LAST >> --updates dictionary pointer (DP) to code field address (CFA) >> -puts HERE (at current CFA) on the stack for use as an XT >> -compiles ENTER into the definition (at current CFA) >> -turns on compiling ] >> -SMUDGEs the definition being compiled (turns on) >> >> : >> -executes :NONAME >> -executes BL WORD to get name of definition >> -executes COUNT >> -sets up values for CMOVE which consumes :NONAMEs XT >> -finds the name field (NFA) >> -executes CMOVE to move the definition's name into the name field >> >> ; >> -compiles EXIT into a definition >> -SMUDGEs the definition being compiled (turns off) >> -turns off compiling [ >> >> CREATE >> -executes : > > Should not execute : as it isn't building a colon definition. It's > building a data object. > >> -places HERE on the stack >> -executes ; > > No need for ; or : > >> -sets the dictionary pointer (DP) to code field address (CFA) > > Why didn't HEADER leave it set correctly? > It's been a while since I worked on it, so I'm not 100% sure what it's doing... It appears from the code an ENTER was compiled in by :NONAME, i.e., DP or HERE moved. So, CREATE creates an empty definition with just ENTER and EXIT. > [edited together] > > The whole purpose of :NONAME is to *not* have a header. > [...] > :NONAME *isn't* linked in the dictionary search; that's why it exists. Does it really matter if :NONAME has a header and is linked? If the header is unfindable by FIND or ' etc... > HEADER should do all the BL WORD COUNT stuff. In other words, it should > build a complete header. And it should *not* do any compiling! Only : > and :NONAME compile stuff. So take out the :NONAME. Ok. Thanks. It appears I need to separate HEADER functionality from three of those four words. I think I prefer HEADER to (CREATE). () seems to be used for low-level words. AIR, : and ; were simpler at one point, since I started from fig-Forth documents. I'll have to see where they became warped... Is it possible to define : in terms of :NONAME, e.g., something like: : CREATE :NONAME DROP ... Where :NONAME would do the compiling and/or SMUDGE? I.e., an attempt not to duplicate the compiling code in both : and :NONAME. Rod Pemberton