Re: Why is the dictionary checked before looking for a number?



It wasn't uncommon on older forths to define

0 CONSTANT 0
1 CONSTANT 1
2 CONSTANT 2

since constants took only one cell in ITC whereas literals
took 2. On some systems constants are faster than literals
as well.

For example, LIT in a simple subroutine threaded 6502 forth is slow,
but if A and Y are free between primitives, then a constant
such as:

; ...
LDA #$FE
LDY #$00
JMP DOCONSTANT

DOCONSTANT:
DEX
STA SH,X
TYA
STA SL,X
RTS

can be much faster.

.