Re: Run-time stack balance verification

From: Charles Melice <mail_at_forthcad.com>
Date: Sat, 18 Dec 1999 13:40:29 +0100

Rick,

This is exactly what I wanted to have !

> Charles,
> The following code will implement a simple version of your requirements.
> You might need to pretty it up a bit, add a few features.
> Hope it helps,
> Rick

I have already found and corrected 2 unbalanced situations using your
system.

This is usefull to check a master word or Window message, and if there is a
problem, to use your balance checker to verify composant words (using the
following on/off system).

    0 VALUE (CHECK-BALANCE)

    : SBAL-ON ( -- ) TRUE TO (CHECK-BALANCE)
        STATE @ ABORT" not in definition" ; IMMEDIATE

    : SBAL-OFF ( -- ) FALSE TO (CHECK-BALANCE)
        STATE @ ABORT" not in definition" ; IMMEDIATE

    : (
       STATE @ IF FIRST? (CHECK-BALANCE) AND IF ...
       ...

I don't know how many hours I have already saved, possibly days.

Great Thank you,
Charles

.
Received on Sat Dec 18 1999 - 13:40:29 PST


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.