To Erich Waelde.

I wrote :
> I think I see a bug in your AmForth v4.9.

You wrote :
>  > ver
> amforth 4.6 ATmega328P ok
>  > 9 0 10 within .
> -1  ok
>  > 10 0 10 within .
> -1  ok

But 4.9 is not 4.6.
And 4.6 is not 4.9.

I do not have AmForth v4.6, but sure that WITHIN word was changed
during transition 4.6 -> 4.9.

Look.
At 4.9 in file ..\core\words\within.asm we now see

; : within >r over > swap r> > or 0= ;
; alternativly
; : within over - >r - r> u< ;

But this are TWO NOT EQUIVALENT definitions of WITHIN !!!

If think in 4.6 it was
: within >r over > swap r> > or 0= ;
and it is NOT according to ANSI standart.

At 4.9 we have
: within over - >r - r> u< ;
and this is ACCORDING to ANSI standart.

What is the difference ?
Look at this :

: WITHIN >R OVER > SWAP R> > OR 0= ;
WITHIN redefined
  Ok
9 0 10 WITHIN .
-1  Ok
10 0 10 WITHIN .
-1  Ok                           <- WRONG !!!
: WITHIN OVER - >R - R> U< ;
WITHIN redefined
  Ok
9 0 10 WITHIN .
-1  Ok
10 0 10 WITHIN .
0  Ok                            <- RIGHT !!!

I think the definition of WITHIN was changed on transition from
4.6 to 4.9, but the definition of TOLOWER was not changed accordingly.

And this is the source of both : a bug and an our misunderstanding.

                              Arthur Ivanov


------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to