Path: csiph.com!usenet.pasdenom.info!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:27995 On Tue, 21 Jan 2014 13:30:26 -0500, Elizabeth D. Rather wrote: > On 1/21/14 6:37 AM, Rod Pemberton wrote: >> On Mon, 20 Jan 2014 17:07:17 -0500, Elizabeth D Rather >>> On 1/20/2014 11:14 AM, Rod Pemberton wrote: >>>> -sets the dictionary pointer (DP) to code field address (CFA) >>> >>> Why didn't HEADER leave it set correctly? >> >> 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. > > CREATE should have neither ENTER nor EXIT since it's a data object, > not a definition. > Um, sorry, I might be wrong about that ... It might be the ENTER from : is stored in the CFA. But, the EXIT from ; would still move DP or HERE at least into the 1st PFA. >>> [snip, moved up] >> >> Is it possible to define : in terms of :NONAME, e.g., something like: >> >> : CREATE :NONAME DROP ... > > Baffled again. Looks like you're defining CREATE, not colon. > Sorry, yes, that should've had two colons which was, hopefully, obvious: : : CREATE :NONAME DROP ... I have a low-level : and this would be for defining a new high-level : in Forth. Is it possible? If so, is it recommended to use :NONAME here or not? >>> 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... > > If it has a header, that defeats the purpose. Why not just have a > normal colon definition? Yes, I'll attempt to do that. I'll probably start by reworking the actions I posted for : ; CREATE and :NONAME into HEADER : ; CREATE and :NONAME. Then, I'll probably backtrack to see where I starting changing the definitions around. I'll likely also have to determine if I had an issue with linking definitions if a headerless :NONAME is used. > It's not the findability that :NONAME is intended to avoid, it's the > space occupied by the header. Ok. So, no header for :NONAME to conserve space. Now, I'm baffled. ISTM, if I do fix the issue with :NONAME by eliminating a header for it, then I'll break :NONAMEs functionality. I'm baffled as to how a :NONAME definition is going to be executable without a header. IIRC, an XT in my system points to the CFA in the header. The CFA field is then fetch'd to determine how to handle the definition as indicated by DOVAR DODOES ENTER etc. Without a header, there won't be a CFA with ENTER for the :NONAME defintion. The XT by itself is insufficient to tell the interpreter *how* to EXECUTE the definition. That's done by ENTER. The XT is only sufficient to tell the interpreter *where* the definition is, more specifically the CFA field in the header from which the header location and definition location can be determined. So, no header, no CFA, no ENTER, no way to tell if the XT points to a definition or a low-level "primitive" word. If I modify EXECUTE , I have no way to determine if the XT is for a regular definition with a header where I need to fetch the CFA, or a headerless :NONAME definition which won't have a CFA with ENTER. Sigh, are there some systems where :NONAME is unimplementable? E.g., ITC interpreted. Also, AIR, this issue of whether :NONAME is headerless or not was brought up previously in regards to ANS Forth. I'm not following ANS strictly, but IIRC that's where :NONAME was defined. AFAICT, ANS Forth doesn't say a :NONAME definition is headerless. It only requires :NONAME to 1) not have a name and 2) not be found. That can be done with a header in place, as I did. So, not having a name is not the same as being headerless. This goes towards the question of: "Does it really matter if :NONAME has a header and is linked? If the header is unfindable by FIND or ' etc..." This is what ANS says: "A.6.1.0460" "... If the current definition was created by :NONAME the current definition has no definition name and thus cannot be found in the dictionary." "A.6.2.0455" ":NONAME allows a user to create an execution token with the semantics of a colon definition without an associated name." *BOTH* :NONAME and : in ANS say they create a _definition_. There doesn't seem to be any mention regarding a difference in the way : and :NONAME create a definition. I.e., does the definition of "definition" include a header or not? ... Rod Pemberton