> While trying to validate my new ANS Forth implemention of StrongForth on
> Win32Forth, I stumbled over an issue with (LOCAL). The generated code didn't
> work, and I finally found out that even the sample definition of LOCALS|
> from appendix A15 of the ANS Forth spec doesn't work correctly:
>
> Win32Forth: a Forth for Windows 95/98/ME/NT/2K/XP
> Version: 6.12.00 Build: 2
> Compiled: Samstag, August 23 2008, 4:18
> Platform: Windows XP, 821k bytes free
> Â 2,885 Words in Application dictionary
> Â 2,332 Words in System dictionary
> Â 5,217 Words total in dictionaries
> 20,312 Windows Constants available
> Current directory: C:\Programme\Win32Forth\extsrc\wincon\winconcpp
> Loading Win32For.CFG
> Loading Win32ForUser.CFG
>
> Program path is: Â Â C:\Programme\Win32Forth\Win32For.EXE
> Forth path is: Â Â Â C:\Programme\Win32Forth\
> Application path is:
>
> System Editor is: Â Â Win32Forth IDE
>
> WARNING OFF SYS-WARNING-OFF Â ok
> : EXAMPLE Â ( n -- n n**2 n**3 )
> Â Â LOCALS| N | Â N Â DUP N * Â DUP N * ; Â ok
> 5 EXAMPLE . . . 125 25 5 Â ok
> : LOCALS| Â ( "
name...name |" -- )
> Â Â BEGIN
> Â Â Â BL WORD Â COUNT OVER C@
> Â Â Â [CHAR] | - OVER 1 - OR
> Â Â WHILE
> Â Â Â (LOCAL)
> Â Â REPEAT 2DROP Â 0 0 (LOCAL)
> ; Â ok
> IMMEDIATE Â ok
> : EXAMPLE Â ( n -- n n**2 n**3 )
> Â Â LOCALS| N | Â N Â DUP N * Â DUP N * ; Â ok
> 5 EXAMPLE . . . 0 0 0
> Â Â Â Â Â Â Â ^
> Error(-4): . stack underflow
> 4 5 EXAMPLE . . . 64 16 4 Â ok
> .S  empty  ok
>
> It seems the runtime code of this redefined version of LOCALS| swallows one
> cell from the stack. Is this a known defect?
>
> Regards,
> Stephan