Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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