Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!ucbvax!BRFAPESP.BITNET!UNBCIC From: UNBCIC@BRFAPESP.BITNET Newsgroups: comp.lang.forth Subject: Align Message-ID: <9106211256.AA29828@ucbvax.Berkeley.EDU> Date: 20 Jun 91 15:56:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: UNBCIC%BRFAPESP.BITNET@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 53 => I think you misunderstood my point ... C, in my example works entirely as => advertised, and allots in 1 byte increments HOWEVER, if a C, leaves HERE at a n => unaligned address, the HERE pointer is advanced to the next aligned address. => The next invocation of ALLOT, HERE etc, will return the padded and aligned => address, but the next C, will assign BEHIND HERE giving a CHERE :-)if you wil l. => I feel no need to actually provide CHERE, and entirely hide the semantic deta il => in the implementation of C,. => => ---> Direction of Growth => {[*][*][ ][ ]}{[ ][ ][ ][ ]}{[ ][ ][ ][ ]}{[ ][ ][ ][ ]} => ^ ^ => CHERE HERE No, I didn't misunderstood your point. That's EXACTLY what I dislike. As your implementation have two pointers instead of one, the overhead is not on ALLOT (etc), but on C,. It doesn't make things better, anyway. => >commom) will be source of lots of errors. I wouldn't like an ALLOT that => >aligns, but, then, you can never satisfy everyone. => => In my example, ALLOT doesn't align, `C,' does. You said that ALLOT always return an aligned address. What about CREATE 15 ALLOT ( name ) 0 , ( age ) ? => Alignment is not just a good idea on most RISC processors, it is the law! For sure. => The cost of alignment on byte oriented machines is, IMHO, negligible. => Further, inclusion of the alignment semantics within the standard would aid => portability immeasurably. Granted, this may be unacceptable in some embedded => systems(?), but this can be overcome with words such as CALLOT, and CHERE wit h => the obvious implied semantics (remember this is Forth we are dealing with!). Leave things working without automatic alignment and it'll be just fine. Anyway, if the embedded system requires as much space as possible, the ALIGNMENT will probably be a byte. DISCLAIMER: It doesn't matter if the current dpANS Forth have this. Although I don't like it, it's just not enough to make me dislike ANS Forth. (8-DCS) Daniel C. Sobral Errare Humanum Est... UNBCIC@BRFAPESP.BITNET ...Perseverare Autem Diabolicum UNBCIC@FPSP.FAPESP.ANSP.BR -------------------------------------------------------------------------- No one, but me, is responsible for the above message.