Forth 200X - problem with file ttester.fs
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
Forth 200X - problem with file ttester.fs         


Author: Gerry
Date: Apr 2, 2008 06:29

I've just been trying out the revised Hayes tester from the Forth 200X
web site (so it ought to be the latest version) and found a problem
with compiling it with a system with no floating point.

After the preliminaries the constants HAS-FLOATING and HAS-FLOATING-
STACK both end up as FALSE.

This leads to the system trying to compile the following

DECIMAL
: COMPUTE-CELLS-PER-FP ( -- U )
DEPTH 0E DEPTH 1- >R FDROP R> SWAP - ;
HEX

when it fails to recognise the 0E in the third line. I presume this is
meant to be recognised as floating point zero. But how is a system
that has no floating point supposed to recognise that 0E is a floating
point number? Even if it did then the FDROP wouldn't be recognised.

Presumably this could be corrected by surrounding this bit of code
with something like

HAS-FLOATING [IF] ( DECIMAL etc )
[ELSE] 0
[THEN]
Show full article (0.89Kb)
1 Comment
Re: Forth 200X - problem with file ttester.fs         


Author: Gerry
Date: Apr 2, 2008 12:29

On 2 Apr, 14:29, Gerry jackson9000.fsnet.co.uk> wrote:
> I've just been trying out the revised Hayes tester from the Forth 200X
> web site (so it ought to be the latest version) and found a problem
> with compiling it with a system with no floating point.
>
> After the preliminaries the constants HAS-FLOATING and HAS-FLOATING-
> STACK both end up as FALSE.
>
> This leads to the system trying to compile the following
>
>     DECIMAL
>     : COMPUTE-CELLS-PER-FP ( -- U )
>         DEPTH 0E DEPTH 1- >R FDROP R> SWAP - ;
>     HEX
>
> when it fails to recognise the 0E in the third line. I presume this is
> meant to be recognised as floating point zero. But how is a system
> that has no floating point supposed to recognise that 0E is a floating
> point number? Even if it did then the FDROP wouldn't be recognised.
> ...
Show full article (1.18Kb)
no comments