|
|
|
|
|
by danbolt
3863 days ago
|
|
This is an enjoyable read! I've been coming across mentions of Forth much more often lately, so it feels satisfying being able to get a sense of it. One thing that caught my attention is that Forth's boolean value for "false" is 0, and for "true" is -1. This makes sense if you look at their binary values, being 00000000 and 11111111, respectively. Does anyone know if there was an underlying design decision for this? Fast hardware checking? Bit masking tricks? |
|
QBASIC (and possibly other Microsoft BASIC dialects?) did the same thing. There's no &&, || or ! in QBASIC.
If you define "true" as just 00000001 then it works for & and |, but not for ~.