scotws / TaliForth2

A Subroutine Threaded Code (STC) ANS-like Forth for the 65c02
Other
86 stars 23 forks source link

Number Constants #259

Closed SamCoVT closed 3 years ago

SamCoVT commented 4 years ago

I was reading through the 2012 standard and found the following in Annex C, which talks about compatibility with older forths and notes changes that might need to be made:

Decimal, hexadecimal, binary number literals can now be written irrespective of BASE by using the prefix #, $, %. Also, character literals can be written as 'c'. Standard programs are unaffected. Systems have to be changed to recognize these forms.

There's also a link to 3.4.1.3 Text interpreter input number conversion that says essentially the same thing.

The means that 'a' should be recognized as the letter "a" and $ABCD is always a hex value and #1234 is always a decimal value and %10110 is always a binary value, regardless of BASE.

SamCoVT commented 3 years ago

Solved by pull request #262