Newsgroups: comp.lang.forth
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!world!dcp
From: dcp@world.std.com (David C. Petty)
Subject: Re: Align
Message-ID: <1991Jun26.163925.26497@world.std.com>
Reply-To: dcp@world (David C. Petty)
Organization: The World @ Software Tool & Die
References: <9106190432.AA02430@ucbvax.Berkeley.EDU>
Date: Wed, 26 Jun 1991 16:39:25 GMT
Lines: 29

In article <9106190432.AA02430@ucbvax.Berkeley.EDU>,
UNBCIC%BRFAPESP.BITNET@SCFVM.GSFC.NASA.GOV writes:

'=>Further, `ALLOT' and `,' should align on
`=> CELL boundaries, and `C,' should ensure that the next invocation of
`=> `HERE', `ALLOT', `,' etc. will utilize a CELL boundary appropriate
`=> to the processor [mine].
`
`C, should ensure that the next invocation of HERE, ALLOT...will utilize a CELL
`boundary?!?!?!?!??!?!?!? It's better live with a slow @ and ! than with this!
`We have only two options: 1) Throw an overhead upon HERE, ALLOT...; 2) Make C,
`ALLOT a CELL, thus actings a comma.

There is a third option.  Put the onus on the _programmer_ to put
ALIGN after the appropriate ALLOT / C, when allocating a data
structure in the dictionary if it is possible that a partial cell has
been allotted.  Then use CELL+ and CHAR+ and ALIGNED when ``stepping
through'' the data structure.  That is the approach taken by ANS
Forth.  

I should also add that most of the alignment calculations can be done
at compile time as in John Hayes' structure implementation (_Forth
Dimensions_ vXI #6).  

-- 
 David C. Petty | dcp@world.std.com | ...!{uunet,bu.edu}!world!dcp /\
      POBox Two | CIS: 73607,1646   | BIX, MCIMail: dcp           /  \
 Cambridge,  MA | `Whatsoever thou doest to the tip,             /    \
02140-0001  USA |  doest thou likewise to the ring.' - RAG      /______\
