On Mar 12, 3:21 pm, Coos Haak <chfo...@[EMAIL PROTECTED]
> wrote:
> Op Wed, 12 Mar 2008 11:56:09 -0700 (PDT) schreef Bruce McFarling:
>
>
>
> > On Mar 12, 2:29 pm, Coos Haak <chfo...@[EMAIL PROTECTED]
> wrote:
> >>> I believe that whether
>
> >>> HEX 0 8000 FFFF 1+ WITHIN . DECIMAL
> >>> and
> >>> HEX 0 8000 FFFF BETWEEN . DECIMAL
>
> >>> ... gives the same result may depend on the size of the cell. For a
16
> >>> bit system, perhaps not.
>
> >>> This is the same modulus problem that makes for both ``?DO'' and
> >>> ``DO''.
>
> >> Did you check? I did, and both gave zero with 16 bit and with 32 bit
> >> implementations as well. What were your expectations?
>
> > Yes, but that computer is not this computer, and I transcribed the
> > arguments in the wrong order. Its
>
> > 8000 0 FFFF BETWEEN .
>
> > which will fail for the boundary condition for a 16-bit system.
>
> > To reproduce the boundary system for any 2's complement system, the
> > address of >IN ought to be somewhere between 0 and max-U, i.e.,
> > TRUE ... does 1+ WITHIN work?
>
> >>IN 0 TRUE 1+ WITHIN .
>
> 0 equals TRUE 1+
> I would call this misuse of WITHIN.
But its an appropriate use of BETWEEN ... kind of, that's the point of
Ed's first post?
Say, you are running on an 8086, with the forth in the codespace, and
one of the other memory space frames being used for something that
fills one type of data from the bottom and another type from the top,
and you want to check whether the size of the total data you want to
shove in there lies between the first free address and last free
address ...
.... surely ``( size 0 TRUE -- ) BETWEEN'' ought to yield TRUE?
That's *why* ``: BETWEEN ( x1 x2 x3 - fl ) 1+ WITHIN ;'' is only a
"mostly correct" definition ... there is a valid range for BETWEEN
that cannot be expressed for WITHIN (actually there are Max-U of them,
but only two that are clear at a glance what they are trying to do).
You get the same problem if you try
-5 MOST-NEGATIVE MOST-POSITIVE BETWEEN
with the two-word definition of BETWEEN. 1+ MOST-POSITIVE and in a 2's
complement machine, it wraps around to most-negative and nothing is
ever within that range.


|