Why is `"\0A"` the default `end` value for `print`?
I saw this in some hover text in vscode and wondered if that was correct. Sure enough the docs confirm this.
I sort of understand the null termination, but why the
'A'
after the null byte?
In the future, can we expect print
to handle null bytes?
e.g., in python, I can do
print | Modular Docs
printTs StringSlice[StaticConstantOrigin] = StringSlice("\0A"), flush FileDescriptor = FileDescriptor(1))
3 Replies
I think it's a typo. It probably means to say
0x0A
(or 10 in base 10) which is ascii for the new line character \n
Interesting, it looks like a bug in the doc generation stuff not printing the escape character nicely, it actually defaults to "\n"
Thanks Chris!