Raku / examples

Many examples of Raku code
https://examples.raku.org/
Artistic License 2.0
294 stars 89 forks source link

Fixed skipping the last word #41

Closed nicqrocks closed 8 years ago

nicqrocks commented 8 years ago

This would originally skip the last word in the line without printing it to the next line. In other words, large lines of text would loose a word when it moved to the next line.

paultcochrane commented 8 years ago

Great catch! Thanks :-)

raiph commented 8 years ago

The code that's being patched (not the patch) looks absolutely awful. Even with the patch it doesn't word wrap to a given line length (which is supposedly its purpose) and I see routine and variable names that are stellar examples of how to be utterly confusing. And this is supposed to have pedagogic merit! I have to run right now but hope to be more specific or write a better version later today.

AlexDaniel commented 8 years ago

Yeah… this code is awful indeed. @raiph++

paultcochrane commented 8 years ago

Nevertheless, with the patch at least the input text is reproduced (modulo trailing whitespace): the old version deleted input content in certain situations. However, I wholeheartedly agree: the code needs a cleanup.