|
|
|
|
|
by yorwba
3358 days ago
|
|
I took this as an opportunity to finally try out mu. Very readable code! Is there a way to write a string that ends with a backslash? The way `slurp_one_past_backslashes` is used seems to make that impossible. EDIT: I thought typing a literal 0 byte might work, but apparently mu uses a different mechanism to delimit strings in memory. |
|
The length of the array cannot be modified, only read (using instruction length). If we need a larger array we must allocate new and copy over, just like in C.
The elements of an array can be read and written using instructions index and put-index, respectively. Here's a fragment of code to make the final character of x a backslash:
[1] The verbose "address:array:char" (read as "address to an array of characters") is typically abbreviated as "text" in Mu programs. I've written out the full type to make things more explicit.