On Mon, Dec 28, 2020 at 11:11:43AM +0100, hwj+gforth.gnu....@mailbox.org 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