[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cset seems to override the next byte

From: Anton Ertl
Subject: Re: cset seems to override the next byte
Date: Mon, 28 Dec 2020 14:08:06 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Dec 28, 2020 at 11:11:43AM +0100, wrote:
> Good morning,
> "cset" in gforth seems to override the next byte:
>       $ gforth -e 'variable a   0 a !   0x0101 a cset   a @ .' -e bye
>       257
> I know "cset" is not in the standard, but (given it's name) I didn't
> expect this behaviour. Is it intended?

In Gforth-0.5.0 SEE CSET shows:

: cset  
  tuck c@ or swap c! ; ok

Since 0.6.2 it shows:

: cset  
  tuck @ or swap ! ; ok

This change is due to us changing the count byte in a word header into
a count cell.  We should have renamed the word when changing the
functionality, but we did not.

Now, after 17 years, the right way to go seems to be to remove CSET
CRESET and CTOGGLE (to let the names cool down).

We use CSET internally, so we may add a word with its current
functionality, but a different name.  The convention would be to call
it SET, but I don't want to waste this name on a little-used word;
maybe MASK-SET or OR! would be appropriate names.

- anton

reply via email to

[Prev in Thread] Current Thread [Next in Thread]