Congratulations on Gforth 0.7.0!

I'd like to propose the following revision to the compilation
logic in the CVS version (revision 1.11) of ttester.fs:

http://www-personal.umich.edu/~williams/archive/forth/utilities/ttester-20081031.fs

The problem I had with the original version was that it wouldn't
load for systems with no floating point, as in the default state
for pfe.

Such a system tries and fails to compile the [ELSE]...[THEN]
clause in lines 209--230 (watch out for line wrap):

HAS-FLOATING-STACK [IF]
 ...

[ELSE]
    : EMPTY-FSTACK ;
    : F{ ;
    : F-> ;
    : F} ;
    : F...}T ;

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

    COMPUTE-CELLS-PER-FP CONSTANT CELLS-PER-FP

    : FTESTER ( R -- )
        DEPTH CELLS-PER-FP < ACTUAL-DEPTH @ XCURSOR @ START-DEPTH @ +
CELLS-PER-FP + < OR IF
            S" NUMBER OF RESULTS AFTER '->' BELOW ...}T SPECIFICATION:
" ERROR EXIT
        ELSE ACTUAL-RESULTS XCURSOR @ CELLS + F@ FCONF= 0= IF
            S" INCORRECT FP RESULT: " ERROR
        THEN THEN
        CELLS-PER-FP XCURSOR +! ;
 [THEN]

That belies the statement in lines 39 and 40:

\ possible; e.g., FLOATING words are used only if the FLOATING wordset
\ is present

The proposed revision modifies the compilation logic so that
floating point words are not used when HAS-FLOATING is false,
and so that the mixed stack words starting with ...}T are then
simply omitted.  The indentation gets a bit nasty.  :-(

I've used it with pfe and gforth for

 * tests for a fairly complex application not involving floating
   point
 * Krishna myneni's fsl test suite (see the .tar.gz at
   ftp://ccreweb.org/software/fsl/)

For pfe, I've also done rudimentary tests with floating point
and an integrated stack.

As far as I can tell, that covers the logic revisions.

-- David

P.S.  I wasn't sure what to do about a change log entry for the
revision in the file itself, so I did nothing.  It appears that,
since the first few revisions, changes have not been logged in
the file, but rather are covered by CVS.  Should there be some
statement in the file about how to find the change record?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to