I read about that, and my instant worry was about the whole world of tabs-vs-spaces. So-called "smart" editors might think that the indent in your example is best served by a tab and some spaces to 'hello', two tabs to 'there', and two tabs and some spaces to 'test'. What is the right amount to remove?
Since indentation is a visual thing but perl and emacs and vim and msdev.exe will likely not discuss their various rendering strategies, these indented here-docs are likely to get out of whack.
-- [ e d @ h a l l e y . c c ] | [reply] |
Presumably, if the terminator is prefixed with 1 or more tabs, then that same number of tabs will be removed from the other lines (if they are present), and if it has 2 spaces and a tab, the 2 spaces and a tab will be removed from the other lines if present?
This won't do the right thing if the whitespace is mixed and variable, but it might do 'the right thing' more often than not.
From what I've read around the Monastery, you'd be forgiven that HEREDOCS were dangerous, unuseful animals that should have been depricated long ago.
It's nice to see an old favorite of mine reinventing itself. I wonder if this change will satisfy its detractors?
| [reply] |
Yep, the leading whitespace will, by default, be matched exactly. If perl6 detects heterogeneous whitespace, it will detab from the first heterogeneous character, assuming 8-spaced hard tabs extending from the margin.
And, yes, there will be a pragma to change that default behaviour in various ways (e.g. to 4-space tabs, full-detabbing, no-detabbing, etc. etc.).
| [reply] |