Skip to content

APPEND: text put together from pieces (format 0.5) - #14

Merged
JohnAmadis merged 1 commit into
mainfrom
feature/append
Oct 10, 2026
Merged

JohnAmadis merged 1 commit into
mainfrom
feature/append

Conversation

@JaxCalder

Copy link
Copy Markdown

Summary

APPEND $d, str appends a string, either a literal or a string variable, to a string variable. It takes as much of the string as the variable's size allows, and works in place without a buffer of that size. FORMAT formats only one number; a number with its unit, or a name with its value, needs several pieces. This is what the JavaScript compiler (dmvs_js) makes of innerText = `${speed} km/h` .

  • The format is now 0.5. APPEND has an entry in the opcode table, the validator (its destination is a string) and the operand layout. The layout test caught the missing layout entry during development.
  • docs/assembly.md (with an example) and docs/binary-format.md are updated.

Depends on todmv#7 (the assembler's APPEND). The tests assemble fixtures/*.dmvs with the released todmv, so CI goes green once todmv#7 is merged and released.

Testing

test_libdmview passes 23/23 with fixtures assembled by todmv#7. The new libdmview_appends_strings step checks pieces appended into "68 km/h" and truncation to the variable's size.

🤖 Generated with Claude Code

APPEND $d, str appends a string - a literal or a string variable - to a
string variable, as much of it as the variable's size takes (in place,
without a buffer of that size). FORMAT formats one number; a number and
its unit, a name and its value need several pieces - what the JavaScript
compiler (dmvs_js) makes of innerText = `${speed} km/h`.

Views using it are version 0.5 (todmv marks them); the operand layout
has its entry (the offsets test checks it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnAmadis
JohnAmadis merged commit 157fd99 into main Oct 10, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants