3 ms·
If you want to print a string from your function, you must supply it to the function. The fact that your function now receives `str: []u8` doesn't make it str-c
by koiueo 1y ago
If you want to print a string from your function, you must supply it to the function. The fact that your function now receives `str: []u8` doesn't make it str-colored.
On a side note: the entire "coloring" metaphor is extremely unfortunate and confusing IMO. It's somewhere at the top of my list (right beside the shroedinger's cat) of things which could've been explained better without dumbing them down.
- woodruffw 1y agoThat’s because str is not a meaningful effect, so we wouldn’t say that a function is “str-colored.” Function coloring is indeed confusing, which is why I’ve been trying to ground this on effects instead. Effects are IMO easier to understand, and this is a straightforward example of effect typing.
- 0x457 1y agoIf this is a special str that you have to pass down all the way through your call stack, then yes, it's str-colored.