Appending strings+PLACE (sometimes known as append) is already added to the core lib, as it's a very common (even if non-standard) word.
Appending characters or numbers
This strings lib adds c+place and #+place for appending a single character or numeric value to a string. Not sure about existing name conventions? This used to be cappend and #append, but being consistent with +place probably makes sense.
Longer counted strings
gbforth supports counted strings (and the related words place and count) that use a single char for storing the string length. This limits the length of counted strings to 255 characters.
Some forth systems use a cell (2 chars) for this, so longer strings are allowed, at the expense of using a bit more bytes for storage. While using strings that are longer than 255 characters might not be very common, it might be nice to support them anyway so that things ✨ just work ✨
Alternatively, we can include a longer-strings.fs lib that redefines the words place and +place (and any other related words) to use a cell count rather than a char count.
Todo
[ ] Name for char +place and num +place words
[ ] Consider using a CELL instead of CHAR for counted strings?
Some extra words for working with strings.
Appending strings
+PLACE
(sometimes known asappend
) is already added to the core lib, as it's a very common (even if non-standard) word.Appending characters or numbers This strings lib adds
c+place
and#+place
for appending a single character or numeric value to a string. Not sure about existing name conventions? This used to becappend
and#append
, but being consistent with+place
probably makes sense.Longer counted strings gbforth supports counted strings (and the related words
place
andcount
) that use a single char for storing the string length. This limits the length of counted strings to 255 characters.Some forth systems use a cell (2 chars) for this, so longer strings are allowed, at the expense of using a bit more bytes for storage. While using strings that are longer than 255 characters might not be very common, it might be nice to support them anyway so that things ✨ just work ✨
Alternatively, we can include a
longer-strings.fs
lib that redefines the wordsplace
and+place
(and any other related words) to use a cell count rather than a char count.Todo
char +place
andnum +place
words