Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!ENG.SUN.COM!Mitch.Bradley From: Mitch.Bradley@ENG.SUN.COM Newsgroups: comp.lang.forth Subject: Addressability of data space Message-ID: <9105021405.AA15589@ucbvax.Berkeley.EDU> Date: 2 May 91 04:20:25 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Mitch.Bradley%ENG.SUN.COM@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 60 > The troublesome clause from BASIS13 is from section 5.3.2. It clearly > states: > > "...it is an exception if a Standard Program addresses memory other > than: > in dictionary space regions: > from the address provided by a CREATEd word or HERE to the end of > the region generated by consecutive allocations ( , C, ALLOT > ALIGN ) made without intervening definitions or deallocations > ( FORGET ); > [rest of this section is about non-dictionary space]" > > This means that if you build a defined word with CREATE (or a word like > DEFER which uses CREATE), say CREATE FOO , you can use the address > returned by FOO. Period. Nowhere does it say you can tick FOO for its > parameter field address, and this clause is carefully worded such that > anything not explicitly > permitted is forbidden. > > Has this clause been fixed in the latest BASIS? Basis 15 says pretty much the same thing (it's now section 5.4). I believe that this text is logically correct. The text says that memory at that address is addressable. It does not, and indeed cannot, enumerate all the possible ways of putting that address on the stack. For example, one could do the following: CREATE FOO 1 C, 2 C, 3 C, 4 C, 5 C, HERE CONSTANT XYZZY 7 XYZZY 5 - C! The point is, section 5.4 says that the memory address provided by a CREATEd word and by HERE is addressable, and that other memory addresses are not addressable. It does NOT say that executing the CREATEd word is the only way of calculating that same address. However, since this section has already been misunderstood, I would like to hear suggestions for how to improve the wording. I find that writing extremely precise English text is a very challenging task. By the way, here's what Basis 15 says about >BODY : 8.1.0550 >BODY "to-body" CORE ( w -- a-addr ) a-addr is the data field address corresponding to the execution token w of a word defined via CREATE . See also: 5.4 Addressable Memory The rationale box says: a-addr is the address that HERE would have returned had it been executed immediately after the execution of the CREATE that defined w. Mitch.Bradley@Eng.Sun.COM