Description
Hello,
The TL;DR of this issue would be: non-breaking spaces are handled differently by words and word quoting structures despite both only talking about whitespaces. This also makes a number of doc code examples wrong about their output.
The process of discovery was the following:
-
https://docs.raku.org/language/traps#___top "using Set subroutines (...)" part
- it produces
"a b"
and returnsFalse
for both code examples - ... for all bisectable6 versions
- it produces
-
- seems to work the same way as
<<>>
but that way also doesn't match the output in the docs:("42 b", "c ")
- seems to work the same way as
-
reason: non-breaking space!
-
https://docs.raku.org/language/quoting#Word_quoting:_qw says:
The
:w
form, usually written asqw
, splits the string into "words". In this context, words are defined as sequences of non-whitespace characters separated by whitespace. -
words does seem to match this description and produce the supposed output with non-breaking spaces as well
-
both can make sense but which one is correct?