SamCoVT / TaliForth2

A Subroutine Threaded Code (STC) ANSI-like Forth for the 65c02
Other
29 stars 7 forks source link

Enforces error on name length > 31; also simplifies ENVIRONMENT? and saves some string bytes #112

Closed patricksurry closed 3 months ago

patricksurry commented 5 months ago

The main change is to complain on names longer than 31 chars (feel free to suggest a better error message).

I also switched the error string encoding to hi-bit terminated instead of null terminated to save some bytes. Another option if you don't like the hi-bit .shift thing would be to use the difference in pointers between adjacent string table entries like I did as part of simplifying/shortening environment?.

After the changes the net image size is 26 bytes smaller.

I tested manually like this:

Tali Forth 2 comes with absolutely NO WARRANTY
Type 'bye' to exit
: supercalifragilisticexpialidocious 3 + ; Name too long (max 31)

Is there a good way to do something like that in a unit test?